How do you test if something is older than 3 months?

后端 未结 4 1018
再見小時候
再見小時候 2021-02-12 21:36

I have been having some trouble to select the rows of my table which has a date of 3 months prior of today. I tried using DATE(NOW() - INTERVAL 3 MONTH) in my where

4条回答
  •  梦谈多话
    2021-02-12 22:06

    Your syntax appears to be wrong.

    That should be

    UPDATE[TCTdb].[dbo].[Stock]
        SET[Warehouse] = 'old'
    WHERE [ManufacturedDate] <= DATEADD(mm, -3, GETDATE())
    

提交回复
热议问题