I am using Sql server 2005 Express edition
(Need to retain Table comport Data for 15days)
I am attempting to Truncate (not delete) data that is older than 15 days based on the MyDate Column within this table.
My specific Example would be based on Database 43577
& the Table would be dbo.comport
The only script that I can find for this is similar to what I have Below:
truncate table comport
Where MyDate <=dateadd(day, -15, getdate())
However this results in:
Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'Where'.
I am very very new to sql & this task was just dumped on me, I am now catching a lot of heat so I`m hoping someone can help me out here..
Thanks in advance
Please advise if there is anything else I should provide.