Speedy Gonzalez
Member
Hi people,
I want to create a trigger which automatically deletes any session records which are 1 day older then today.
So something like this will work if I used the keyword TODAY:
for each sessiontable where sessiontable.dsess < TODAY -1:
delete sessiontable.
end.
The dsess field is of the type DATE so the -1 can work for this.
However I'm using the DATETIME-TZ type. The keyword to get the time and date of this day is: NOW.
Now with this type I can't just type -1 at the end.
So my question. What is the correct syntax to get the the previous day of the set date (NOW -1 doesn't work)?
Many thanks in advance!
I want to create a trigger which automatically deletes any session records which are 1 day older then today.
So something like this will work if I used the keyword TODAY:
for each sessiontable where sessiontable.dsess < TODAY -1:
delete sessiontable.
end.
The dsess field is of the type DATE so the -1 can work for this.
However I'm using the DATETIME-TZ type. The keyword to get the time and date of this day is: NOW.
Now with this type I can't just type -1 at the end.
So my question. What is the correct syntax to get the the previous day of the set date (NOW -1 doesn't work)?
Many thanks in advance!