In order to bind DATETIME, i suggest to convert the date to double, then use SQLFLT8 instead of SQLVARCHAR.

In SQL Server Datetime is a standard double. The integer part represent the number of days since 1-1-1900 and the fractional part represent the fraction of the day (e.g: 0.5 means noon, 0.75 means 6 PM).

Using SQLVARCHAR may lead to errors depending on the local server config.

<?phpfunction PhpTimeToOLEDateTime($timestamp){$a_date = getdate ($timestamp);$year= $a_date['year']; //this year$partial_days = ($year-1900)*365;//days elapsed since 1-1-1900 //let's calculate how many 29 february from 1900 to first day on this year$partial_days +=(int)(($year-1) / 4); //each 4 years a leap year since year 0$partial_days -= (int)(($year-1) / 100); //each 100 years skip a leap$partial_days += (int)(($year-1) / 400); //each 400 years add a leap$partial_days -= 460; //459 leap years before 1900 + 1 for math (year 0 does not exist)$partial_days += $a_date['yday'];

Use:SQLVARCHAR for binarySQLINT4 for datetimeSQLFLT8 for decimalSQLVARCHAR for imageSQLFLT8 for moneySQLCHAR for ncharSQLTEXT for ntextSQLFLT8 for numericSQLVARCHAR for nvarcharSQLFLT8 for realSQLINT4 for smalldatetimeSQLFLT8 for smallmoneySQLVARCHAR for sql_variantSQLINT4 for timestampSQLVARCHAR for varbinary