Question : SQL Query to delete all records older than 365 days

I need to write a sql query to delete all records in my database older than 365 days.  The date/time field name is called 'DateShipped'.  TIA!

Answer : SQL Query to delete all records older than 365 days

delete from tableName
where DateShipped < dateadd( dd, -365, convert(varchar,getdate(),112)  )
Random Solutions  
 
programming4us programming4us