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.
 
Back
Top