|
-
Aug 14th, 2000, 05:44 PM
#1
Thread Starter
Addicted Member
Does anyone know how I can use a SQL statement to delete records older than say 1 hour?
I've got 1000 records all stamped with a Date and 24/h Time in the "lastupdate" field of this database on MS SQL server.
What I am wanting to do is delete any record older than 1 hour... does anyone know how I can do this without creating a recordset and checking each row?
Prompt response would be greatly apprecieated!
-
Aug 14th, 2000, 07:32 PM
#2
Don't do it! Let's talk this thru now ...
The SQL statement should look something like this:
DELETE FROM MyTable
WHERE DATEDIFF (hh, lastupdate, GETDATE()) > 1
"It's cold gin time again ..."
Check out my website here.
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
|