I just need a where condition in my select statement where AddedDate is less than or within the 3 month backet. Like
我只需要在我的select语句中where where条件,其中AddedDate小于或在3个月的backet中。喜欢
Select * FROM My Table where AddedDate DateDiff of DateNow less than 3 months
3 个解决方案
#2
5
SELECT *
FROM MyTable
WHERE AddedDate >= DATEADD(month, -3, getdate())
#3
1
not entirely sure that I understand but I think this is the function you need
不完全确定我理解,但我认为这是你需要的功能
where AddedDate >= dateadd(mm, -3, getdate())
#1
#2
5
SELECT *
FROM MyTable
WHERE AddedDate >= DATEADD(month, -3, getdate())
#3
1
not entirely sure that I understand but I think this is the function you need
不完全确定我理解,但我认为这是你需要的功能
where AddedDate >= dateadd(mm, -3, getdate())