Knowledgebase
[QODBC-Desktop] Troubleshooting - Does QODBC support "like 'i%'"?
Posted by Jack - QODBC Support on 10 November 2016 07:41 AM

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

 

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).