Display record older than 3 months in sql

前端 未结 2 1203
南方客
南方客 2020-12-17 20:38

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) a

2条回答
  •  有刺的猬
    2020-12-17 21:11

    What you posted is not MySQL. Assuming you are using MS SQL Server, you should use the ABS() function.

    SELECT   * FROM        T1
    WHERE     ABS(DATEDIFF([month], ALERT_TIMESTAMP, GETDATE())) > 3
    

提交回复
热议问题