
July 16th, 2003, 07:09 AM
|
|
Registered User
|
|
Join Date: Oct 2002
Location: North Devon - England
Posts: 20
Time spent in forums: 25 m 5 sec
Reputation Power: 0
|
|
|
Syntax Error
I'm getting this error message:
SQLState: 42000
Native Error Code: 1064
[TCX][MyODBC]You have an error in your SQL syntax near '2003-06-01' AND '2003-08-01' ORDER BY i_date ASC' at line 1
In the database i_refid is a VARCHAR and i_date is DATE format.
I'm using ASP with a mySQL database, and the string I'm using is:
SET rsFind = Server.CreateObject("ADODB.Recordset")
mySQL = "SELECT * FROM Invoicez WHERE i_refid = '" & myref & "' AND i_date BETWEEN '" & begindate & "' AND '" & enddate & "' ORDER BY i_date ASC"
rsFind.Open mySQL, strCon
begindate and enddate is being sent as YYYY-MM-DD or YYYY/MM/DD with the same error message.
Can anyone offer any suggestions?
Johnie
|