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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax for "LIKE" with Pervasive 2000i SP3

Status
Not open for further replies.
Jun 4, 2004
19
0
0
US
Hi,

I'm using LIKE in a SQL statement, as below. Evidently my syntax is incorrect at the end of the statement, however I'm not sure what the problem is -- everything looks fine to me. Any suggestions? Thanks in advance.

WHERE (LeaseCompany.LeaseCompanyNum = '09')
AND ((OpeninvInvoice.InvDueDate >= 20040901 AND OpeninvInvoice.InvDueDate <= 20040928 AND OpeninvInvoiceHist.HistRegisterType = 'IN')
OR (OpeninvInvoiceHist.HistDate >= 20040901 AND OpeninvInvoiceHist.HistDate <= 20040928 AND (OpeninvInvoiceHist.HistRegisterType = 'AD' OR OpeninvInvoiceHist.HistRegisterType = 'CD' OR OpeninvInvoiceHist.HistRegisterType = 'CM'))
AND (OpeninvInvoiceHist.HistTranCode LIKE 'INT%' OR OpeninvInvoiceHist.HistTranCode LIKE 'NOTE%' OR OpeninvInvoiceHist.HistTranCode LIKE 'RENT%' OR OpeninvInvoiceHist.HistTranCode LIKE 'XTR%')

 
The error message is:

[Pervasive][ODBC Client Interface][Pervasive][ODBC Engine Interface]Syntax Error: 'CM')) AND (OpenivnInvoiceHist.HistTranCode LIKE 'INT%' OR OpeninvInvoiceHist.HistTranCode LIKE 'NOTE%' OR OpeninvInvoiceHist.HistTranCode LIKE 'RENT%' OR
OpeninvInvoiceHist.HistTranCode LIKE 'XTR%')<<???

Hopefully that provides useful clues....


Robin
 
Just got a response on another list -- I was missing a parenthesis after "'CM'))" I needed three rather than just two. Thanks for your willingness to help out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top