Quick SQL syntax check (hopefully!)
Quick SQL syntax check (hopefully!)
(OP)
Can anyone tell me what's wrong with this SQL expression?
The error message is just a syntax error, so I'm sure it's easy if you speak SQL...
SELECT CASE WHEN "Variety" <> '' THEN "Date" || "Denomination" || "Variety" ELSE "Date" || "Denomination" END AS "Concat", "InventoryID" FROM "tblInventory"
The error message is just a syntax error, so I'm sure it's easy if you speak SQL...
SELECT CASE WHEN "Variety" <> '' THEN "Date" || "Denomination" || "Variety" ELSE "Date" || "Denomination" END AS "Concat", "InventoryID" FROM "tblInventory"
RE: Quick SQL syntax check (hopefully!)
so if you're getting a syntax error, it's because your particular database system isn't completely ANSI-compliant
what database system are you actually running, and what was the exact error message?
r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
RE: Quick SQL syntax check (hopefully!)
Turns out that I'd be better off using a COALESCE statement than the CASE or CASEWHEN. OOBase would have been OK with CASEWHEN, apparently, but COALESCE is much tidier, and it works!
thanks a lot, and I'm sure this isn't the last you'll hear from me!
Declan