Delete Query - Please Help

  • Thread starter Thread starter Sthibodeau
  • Start date Start date
S

Sthibodeau

I have built a delete Query that i want to delete all
records in a table that are less 30 days from the date of
executing the query.

Here is the criteria i have written, but it only deletes
records less than todays date, i alwyas want at least the
past 30 days of records in the system.

<Date()-(30)

Please help in telling me what i am doing wrong - Thanks
 
Thanks for the input - But that also deltes all records
before todays date including the ones that fall within the
past 30 days.

Any other suggestions?
Scott
 
Sorry...misread your post.

Change your criterion expression to this:
Between (Date() - 30) And Date()

If that gives you trouble, then create a calculated field in the query:
DateLess30: DateDiff("d", [NameOfYourDateField], Date())

Use this criterion expression for this calculated field:
<30
 
Back
Top