Question Validation Rule

Boddington6

New member
Local time
Today, 22:15
Joined
Apr 8, 2009
Messages
4
I'm having trouble trying to sort out a validation rule for a database.
I want students who have passed after two years to be deleted off the database and to do this I'm running a delete query, however I can't seem to get the validation rule right which will delete them off through the query. I thought perhaps there was a way to use <Date() (meaning todays date) and then 2 years before it so that the query would automatically find dates that were before two years from todays date, not just the year? This would really help the database so that I don't have to create a new query at the end of each year.
Any help would be much appreicated.
Thank you.
 
Not to side-step your problem but I would not delete the students but rather just add a field that will let you change their status to inactive or move the record to an archive table. It's kind of an unwritten rule to never delete data once you've gone through the trouble of collecting it. You never know when your 'old' data can be used for strategic reporting.
 
I understand, and it would make sense to do that, but unfortuantely these are the criteria I've been asked to stick too so I think I should at least create the query and then they can choose whether to use it or not.
Thanks.
 
MyCreationDateField < Date()-365 should give you everthing older than a year
 
Not too sure on how you would code it but reckon that you could use datediff to work out how long there was between students passed date and the current date. This should allow you to validate.
 
Glad you have it working.

Edit: BTW - Welcome to the forum!
 

Users who are viewing this thread

Back
Top Bottom