Programming help

  • Thread starter Thread starter Belle Sweet
  • Start date Start date
B

Belle Sweet

Can anyone help me!!!
I need the code that would delete entries in my database
after they are there for a specified amount of time. I
have a field called days posted.
Thanks
Belle
 
Dear Belle,
someone told my driving a car
now i have a steer, four wheels, a key and many streets to drive
through.
Can you help me ?
plz describe when to delete and in which form you will implement such
a thing, the Tablename...
e.g. When Field [days posted] is two weeks ago then delete those
records in Table <Contacts> without any user-interaction.
BTW a simple one is
Docmd.Execute "DELETE * FROM <tablename> WHERE [days posted]<#" Date()
& "#"
Heiko
:-)
 
I need the code that would delete entries in my database
after they are there for a specified amount of time.

DELETE FROM MyTable
WHERE MyTable.DatePosted < #2003-05-01#;


or if you wanted to get really fancy,

DELETE FROM MyTable
WHERE MyTable.DatePosted < DateAdd("d",-30,Date());


Hope that helps


Tim F
 
Back
Top