LibreOfiice 7.4, Windows
I am trying to build a query that uses the CASE WHEN function to check a transaction date and sets the appropriate financial year
SELECT “ID”,
CASE
WHEN “Date” < “31/10/22” THEN ‘2022’
WHEN “Date” < “31/10/23” THEN ‘2023’
END AS “FinYear”,
“Date”, “Paid in”, “Paid out”
FROM “EventTransactions”
Base can save the query, which I take to mean that syntax is correct but when I test the query I get the following alarm
Column not found: 31/10/22 in statement [SELECT “ID”, CASE WHEN “Date” < “31/10/22” THEN ‘2022’ WHEN “Date” < “31/10/23” THEN ‘2023’ END AS “FinYear”, “Date”, “Paid in”, “Paid out” FROM “EventTransactions”]
I have tried also a CASEWHEN (exp,result1, result2) and that bombs out too.
What am I doing wrong.
Many thanks
Robert