Hi everyone, i want a query that delete rows from a table that are older than 3 days. There is a column with the datetime. Thanks in advance
DELETE MyTable WHERE DateTimeColumn < DATEADD(DAY, -3, GETDATE()) Note that because of the time portion involved here, the statement does not delete rows from 3 days ago where the time was later than the current time. If that is not what you want you would have to strip out the time portion in GETDATE().