delete old records

Results 1 to 2 of 2

Thread: delete old records

  1. #1
    Join Date
    Dec 1969

    Default delete old records

    How can I delete records older that 30 days from today in an access database?

  2. #2
    Join Date
    Dec 1969

    Default RE: delete old records

    DELETE FROM tablename WHERE dateOfRecord &#060; ( Date() - 30 )<BR>or<BR>DELETE FROM tablename WHERE dateOfRecord &#060; DateAdd(&#039;d&#039;,-30,Date())<BR>or<BR>DELETE FROM tablename WHERE DateDiff( &#039;d&#039;, dateOfRecord, Date() ) &#062; 30<BR><BR>All of those *assume* that you put a field into the record that indicates when it was added to the DB. Access doesn&#039;t do that automatically, so if you didn&#039;t do it the DB has no way of knowing how old a record is!<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts