duncanstreet2004
MIS
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%')
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%')