Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting data from a table after 'x' months

Status
Not open for further replies.

1ooo1

Technical User
Jan 20, 2003
50
AU
Hi,
Is this at all possible, I have a table that I want to use for 7 months, after which I want all records from all fields except the Key Field deleted, so that 'fresh records' can entered. So on a given date 7 months in advance, I want all fields except the key Field to be cleared.

Ken
 
Is there any particular reason you want to reuse the key field? It seems to make more sense to delete the entire records, or at least archive it, so that you have a record of it.

Certainly, what you are asking is possible. You could have a query run each time the database opens that clears out these fields. You'd need a field in your table that has the date the record was created. If the date the record created < DateAdd(&quot;m&quot;,-7,now()), then you'd update each field in the record to Null.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top