Im using VBA with Excel to retrieve data using the QODBC.
I want to put this SQL Query
SELECT SUM(TOTAL) AS Import
FROM
(SELECT CASE WHEN(PurchaseOrder.VendorRefFullName = 'Bob') THEN PurchaseOrder.Amount * 10.8 ELSE PurchaseOrder.Amount END AS TOTAL
FROM PurchaseOrder
WHERE (PurchaseOrder.TxnDate >= {d '2006-04-17'}) AND (PurchaseOrder.TxnDate <= {d '2006-04-23'})) Provider
How does the CASE Statement works in QODBC? |