Troubleshooting - Does QODBC support "like 'i%'"?
Problem Description:
How should the following SQL query be written to work with QODBC, using the "like" filter to restrict records?
SELECT Sales.RefNumber, Sales.BillAddressAddr1, Sales.Type, Sales.TxnDate FROM Sales WHERE Sales.BillAddressAddr1 = 'Customer Name' AND Sales.TxnDate <= {d '2006-04-09'} AND LOWER(Sales.Type) LIKE 'c%' ORDER BY RefNumber
Solution:
There's no problem with LIKE any value. However, that's not how we support the LOWER function. This query executes without error:
SELECT Sales.RefNumber, Sales.BillAddressAddr1, Sales.Type, Sales.TxnDate FROM Sales WHERE Sales.BillAddressAddr1 = 'Customer Name' AND Sales.TxnDate <= {d '2006-04-09'} AND {fn LCASE(Sales.Type)} LIKE 'c%' ORDER BY RefNumber
But I don't have any "Credit "data that qualifies. However, running the following query shows how like "i%" works to find "Invoice" type sales:
SELECT Sales.RefNumber, Sales.BillAddressAddr1, Sales.Type, Sales.TxnDate FROM Sales where {fn LCASE(Sales.Type)} LIKE 'i%' ORDER BY RefNumber
|