Reputation: 5859
I just need a where condition in my select statement where AddedDate is less than or within the 3 month backet. Like
Select * FROM My Table where AddedDate DateDiff of DateNow less than 3 months
Upvotes: 10
Views: 38899
Reputation: 36156
not entirely sure that I understand but I think this is the function you need
where AddedDate >= dateadd(mm, -3, getdate())
Upvotes: 1
Reputation: 4854
SELECT *
FROM MyTable
WHERE AddedDate >= DATEADD(month, -3, getdate())
Upvotes: 6