February 13th, 2012, 03:34 PM
Delete older than
I am trying to purge older data than a year ago using ibase6. My statement is:
DELETE FROM "Event_Log" WHERE "EventDateTime" < (CAST('NOW' AS DATE)-365 );
No error, but doesn't delete the records when run and commited. Any help?
February 15th, 2012, 03:28 PM
I see no one has answered so I will take a stab at it.
1. Are you sure that the database was created with
case sensitive table and field names? That would be most
If they are, then check that your table and field names are correctly
capitalized. If not, then dump the quotes round the table and field names.
2. I have not used Interbase for years and Firebird has key words that do not require
quotes, so I apologize if these suggestions are no good.
< ('NOW'-365 ); // probably no good
<CAST((CAST('NOW' AS DATE)-365 ) AS DATE);