Delete Query - Please Help

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
 
S

Sthibodeau

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
 
K

Ken Snell

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top