SQL Server receipt date field if less than 3 months

I just need the where clause in my select statement, where AddDate is less than or within a 3 month set. how

Select * FROM My Table where AddedDate DateDiff of DateNow less than 3 months 
+6
source share
3 answers

Use DATEADD () :

 Select * FROM My Table where AddedDate>=DATEADD(m, -3, GETDATE()) 
+18
source
 SELECT * FROM MyTable WHERE AddedDate >= DATEADD(month, -3, getdate()) 
+5
source

not quite sure what I understand, but I think you need this feature

 where AddedDate >= dateadd(mm, -3, getdate()) 
+1
source

Source: https://habr.com/ru/post/907226/


All Articles