First day of the next month

前端 未结 7 2169
自闭症患者
自闭症患者 2021-02-07 00:37

I\'m trying get the results where it only displays OrderDates before the LAST day of the CURRENT month. I\'m guessing it would be like this...

SELECT OrderDate
F         


        
7条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 00:42

    SELECT DATEADD(month, DATEDIFF(month, 0, getdate())+1, 0) AS StartOfMonth
    

提交回复
热议问题