Full Version: Auto Delete Record by date
UtterAccess Forums > Microsoft® Access > Access Date + Time
Lee_Matthews
Hi all
Owork for a small Manufacturing Company. We have just designed a database to manage our stock control. One location is Production Floor which is where we transfer all our raw materials to get made into finished goods. In the database every transaction is date stamped.
Is there a way that the database can see that a raw material has been transfered into the location "Production Floor" and has been there for 2 days then will delete it from the system?
Im just starting to learn Access and im working with one other guy who knows a bit about it.
Any ideas would be great
Thanks in advance
Lee
Alan_G
Hi
Create a new delete query and add the appropriate table. Add your Location Field. In the criteria of Location use "Production Floor", then in a new field type
ExpiredDate:DateAdd("d",2,[YourDateField])
Save your query and run it from wherever you want............
HTH
Alan
truittb
Usually instead of deleting the record, it is considered a better practice to flag the record as deleted, allowing it to remain for historical purposes.
You would do this with an UPDATE query.
Lee_Matthews
Thanks for that, Ill give that a go.
Thanks
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.