If you enter a record into a database based on its date and want a turnaround in the database of two days is there a way to delete anything thats two days old from the database on a daily basis?
Printable View
If you enter a record into a database based on its date and want a turnaround in the database of two days is there a way to delete anything thats two days old from the database on a daily basis?
MS Access:
SQL Server:Code:DELETE FROM TableName WHERE Datefield>=#01/01/2005# and DateField<=#02/01/2005#
Code:DELETE FROM TableName WHERE DateField>='2005-01-01' and DateField<='2005-01-02'
Yes thats a way if it were just for today but tomorow i want to come in and delete things that are two days old also , and every day , is there a method attached to date that can do this do you know?
Create a app containing this query then add this exe to Windows Scheduled Tasks.
ok il try that, thanks, not too sure how tho but il give it A go?
if you want to just do it when you program starts, how about
VB Code:
Dim d As Date d = DateAdd("d", 2, Date)
then run your query against > d
rgds pete