yyyymm - tsql convert string to number




在T SQL中將日期添加到日期 (4)

如何將一個月添加到我在where子句下檢查的日期?

例如:

select *
from Reference
where reference_dt + 1 month


使用MSDN

DATEADD(month, 1, reference_dt)

select * from Reference where reference_dt = DATEADD(mm, 1, reference_dt)

select * from Reference where reference_dt = DateAdd(month,1,another_date_reference)




datetime