Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Error when reading with Dates.

Status
Not open for further replies.

wolfen1842

Programmer
Jan 24, 2007
4
US
HEre is the select statement I am using:

SELECT SUM(Amount) AS Paid FROM PR_23PerptHistoryDetail WHERE Dept = '99' AND EmployeeNumber = 'BARTKIM' AND (CheckDate > {d '2007-2-4'} AND CheckDate < {d '2007-2-11'} ) AND (EarningCode = '90' OR EarningCode = '97')

When this code runs, I get an Error that states "ERROR [3700] [ProvideX][ODBC Driver]Expected lexical element not found: <identifier>"

If I remove the CheckDate from the select statement, I get the data. Any ideas what I am doing wrong?

Thank you
 
Never mind. I figured it out. The formating on the date HAS to be yyyy-MM-dd. I had one digit for the month and for the date.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top