Form with table and view showing displaying the date off by one. Saving the date off by one.

Hi,

I have a query with subqueries that works as it is.
In a subquery, I have the following condition :

WHERE YEAR(“tMytable”.“date”) < YEAR(:inputDate)

I want to improve the subquery execution speed, so I want to get rid of the YEAR(“tMytable”.“date”).
I tried some combinations with TO_DATE(), TO_CHAR(), DATE_SUB() …
I also tried with DATEFROMPARTS() but I think I can’t use it with hsqldb.

Here is what I would like to work :

WHERE “tMytable”.“date” <= date_SUB( :inputDate, ‘DD/MM/YY’), interval ‘12’ MONTH)

Can you help me with the syntax? I can’t figure what is the good format or set of formulas to make this work.

Hello,

Your main question (date off by one) and the detail (improve sub query) are two different items. Please fix.