#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    8
    Rep Power
    0

    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?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    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
    unusual.
    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.

    Try these

    < ('NOW'-365 ); // probably no good

    <CAST((CAST('NOW' AS DATE)-365 ) AS DATE);

IMN logo majestic logo threadwatch logo seochat tools logo