HestonJames
Programmer
Afternoon Guys,
I've got a table with a DateTime column and I want to form a query which will remove all records from that table who's DateTime column is greater than a given date.
So, my first instinct would be to write something like this:
However, something tells me that this is a risk and that the datetime shouldnt be in a string format like that, correct?
I'd appreciate your thoughts on how to make it a little safer so i dont go deleting a load of records i dont want to delete.
Heston
I've got a table with a DateTime column and I want to form a query which will remove all records from that table who's DateTime column is greater than a given date.
So, my first instinct would be to write something like this:
Code:
DELETE FROM MyTable
WHERE DateColumn > '2008-01-25 00:00:00'
However, something tells me that this is a risk and that the datetime shouldnt be in a string format like that, correct?
I'd appreciate your thoughts on how to make it a little safer so i dont go deleting a load of records i dont want to delete.
Heston