|
-
Feb 2nd, 2005, 04:13 AM
#1
Thread Starter
Junior Member
Date query
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?
-
Feb 2nd, 2005, 04:25 AM
#2
Re: Date query
MS Access:
Code:
DELETE FROM TableName WHERE Datefield>=#01/01/2005# and DateField<=#02/01/2005#
SQL Server:
Code:
DELETE FROM TableName WHERE DateField>='2005-01-01' and DateField<='2005-01-02'
Last edited by Deepak Sakpal; Feb 2nd, 2005 at 04:32 AM.
-
Feb 2nd, 2005, 04:31 AM
#3
Thread Starter
Junior Member
Re: Date query
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?
-
Feb 2nd, 2005, 04:34 AM
#4
Re: Date query
Create a app containing this query then add this exe to Windows Scheduled Tasks.
-
Feb 2nd, 2005, 04:38 AM
#5
Thread Starter
Junior Member
Re: Date query
ok il try that, thanks, not too sure how tho but il give it A go?
-
Feb 2nd, 2005, 08:37 AM
#6
Re: Date query
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|