Hello,
I am using LO base 6.3.5.2 with an HSQLDB.
I have an SQL request which works and looks like this :
SELECT .... (attributes)
FROM myTable, [..](tables)
WHERE ....(relationships)
AND "myTable"."date" BETWEEN {d '2018-01-01' } AND {d '2018-12-31' }
Now I want to introduce a parameter (:endOfYearDate) to let the user choose the date.
If I replace the last line of my formula by the following, it still works :
AND YEAR("myTable"."date") = YEAR(:endOfYearDate)
But if I use a function on the date parameter only, I can’t make this work :
AND "myTable"."date" BETWEEN DATE_SUB ( :endOfYearDate, INTERVAL 12 MONTH ) AND :endOfYearDate
I tried some variations but none of them would work.
Can you give me the working syntax on this one ? I tried the CONCAT (YEAR(:endOfYearDate),… doesn’t work either.
Thanks.