本文介绍了如何在 SQL 中为 CURRENT_TIMESTAMP 添加月份?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何向 SQL Server 中的 CURRENT_TIMESTAMP 添加月份?
How can I add months to the CURRENT_TIMESTAMP in SQL Server?
解决方案可能在于 DATEADD() 但这仅适用于日期,而不适用于日期时间.
The solution probably lies in DATEADD() but this works with a date only, not a datetime.
谢谢.
推荐答案这很好用
SELECT DATEADD(month,1,CURRENT_TIMESTAMP)来自 DATEADD (Transact-SQL)
日期
是一个表达式,可以解析为时间、日期、smalldatetime、datetime、datetime2 或日期时间偏移值.
Is an expression that can be resolved to a time, date, smalldatetime, datetime, datetime2, or datetimeoffset value.
更多推荐
如何在 SQL 中为 CURRENT
发布评论