📜  tsql 获取年初 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:28.136000             🧑  作者: Mango

代码示例1
SELECT
   DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0) AS StartOfYear,
   DATEADD(yy, DATEDIFF(yy, 0, GETDATE()) + 1, -1) AS EndOfYear