I'm having problems when I attempt to include a Date comparison in the where clause of my SELECT statement The error I'm getting is: ERROR [42000] [QODBC] Expected lexical element not found: <identifier> and my SQL Statement is as follows:
"Select AccountNumber as PropertyID, AltContact as PropertyAddress, CustomerTypeRefFullName as Type, Fax as Code, Contact as Owner, Phone as Phone1, AltPhone as Phone2, BillAddressAddr1 + ' ' + BillAddressAddr2 as MailingAddress,TermsRefFullName as Status, ResaleNumber From Customer where TimeModified > {d'9/30/2007'} ORDER By AccountNumber"
If I remove the {d' syntax from the date comparision yielding the following SQL:
"Select AccountNumber as PropertyID, AltContact as PropertyAddress, CustomerTypeRefFullName as Type, Fax as Code, Contact as Owner, Phone as Phone1, AltPhone as Phone2, BillAddressAddr1 + ' ' + BillAddressAddr2 as MailingAddress,TermsRefFullName as Status, ResaleNumber From Customer where TimeModified > '9/30/2007' ORDER By AccountNumber"
If then receive this error
ERROR [42S00] [QODBC] Invalid operand for operator: >
Can you please provide some instruction on using date comparisons in the WHERE clause for a SELECT statement?
Thanks,
Tom A |