My column is named order_date
and the data for it is:
datetime NOT NULL DEFAULT GETDATE(),
This will make data appear as:
Apr 8 2014 3:24PM
I am wondering what PHP Query I can use to delete any rows in this MSSQL table if they are one year old or older.
I would also like a way to test if this works. (IE: Modifying a current row's order_date
column to make it a year older.)
If anyone can help me with this it is greatly appreciated. T
delete from tracking_orders where DATEDIFF (year, order_date, GETDATE()) > 1
Check here: