📌  相关文章
📜  swl 中的上一年开始和结束日期 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:43.352000             🧑  作者: Mango

代码示例1
--To get the first day of the previous year in SQL Server, use the following code:
SELECT DATEADD(yy, DATEDIFF(yy, 0, GETDATE()) - 1, 0)
--To get the last day of the previous year:
SELECT DATEADD(dd, -1, DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0))