Hi guys I have looked around on Google but can't quite figure out why I ma getting this error...
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '#'.
My Date field known as
Trandate is Date/Time format and in my sql I have the following statement:
Code:
mysql = mysql + "WHERE sldetail.[trandate] "
mysql = mysql + "BETWEEN #10/01/2005# AND #25/01/2005# "
When I use this statement:
Code:
mysql = mysql + "WHERE sldetail.[trandate] "
mysql = mysql + "BETWEEN '10/01/2005' AND '25/01/2005' "
It brings up this:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.
Any comments and suggestions are welcome. Thank you.