I need to create a SSIS package that will go through the records in one table(T1) older than 3 months (based on ALERT_TIMESTAMP) and move them to another table(T2)
My query is :
SELECT * FROM T1
WHERE (DATEDIFF([month], ALERT_TIMESTAMP, GETDATE()) > 3)
Alert_timestamp column is in Datetime format. eg: '10/26/2012 12:00:00 AM'
When I run the query it should display all the records that are older than 3 months, but it does not.
Try this
For days, year see below for example.
For Anand, query