I'm running a oracle sql in php, but I believe this is more Oracle related. If anyone can help, I'd appreciate it.
I have a date column in an oracle table. The column is named "updated_date". I need to update all records in this table where the date in updated_date is previous to seven days. ie. sysdate = 4/15/05, so I need to update records with a date before 4/08/05
my where clause is like so but doesn't seem to work.
where trunc(updated_date) < ( trunc(sysdate) - 7 )
This is updating records with april 10, 2005 in the updated_date field. Hmmm.
I've done some sql in an oracle window, and trunc(sysdate) - 7 returns April 08, 2005 (today is 4/15/05) so this works.
any thoughts?? Thanks