Deleting 5 year old records!

atiq

Registered User.
Local time
Today, 00:48
Joined
Apr 11, 2007
Messages
23
i know this must be a piece of cake but i'm new to Access!

Anyway, am using a delete query and want an expression that i can use in the criteria to allow me to detect (and delete) records that are 5 years old. i used Date() - 1825 but was wondering if there was any other way or function that would allow me to acheive this. any help regarding this would be appreciate! hope someone can help.
 
Sure how about
if DateAdd("y",5,[yourdatefield])<date() Then
Delete
 
Sometimes I just do it manually. Make a simple query for that table with the date <= now()-1825 and then click the upper left corner, and hit the delete button. Voila! Don't even bother saving the query.
 

Users who are viewing this thread

Back
Top Bottom