DATE_SUB and DATE_ADD in H2 for MySQL
Finally I was able to solve it. I had to change DATE_ADD
for TIMESTAMPADD
and DATE_SUB
with TIMESTAMPDIFF
. Then I changed CURDATE()
for CURRENT_DATE
. Also the sign of the method change but works on both H2 and My.
SELECT *FROM subscriptionsWHERE active_until >= (TIMESTAMPDIFF(DAY, 3, CURRENT_DATE))AND active_until <= (TIMESTAMPADD(DAY, 1, CURRENT_DATE))AND status LIKE 'ACTIVE'