-
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!
-
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