delete query

  • Thread starter Thread starter tom
  • Start date Start date
T

tom

How do I write a query that will delete all rows in a
table where the date column is greater than 30 days old?

Thanks in advance!

Tom
 
DELETE [invoice date]+30 AS idate, [a/r open].*
FROM [a/r open]
WHERE ((([invoice date]+30)<Date$()));

Not sure if it is a plus or minus 30 please double check!

Hope this helps

Martin
 
DELETE * FROM YourTable
WHERE TheDateField < Date()-30

Or

DELETE ...
WHERE TheDateField < DateAdd("d",-30,Date())

TEST on a copy of your data to see if it works.
 

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

Back
Top