nitin singh

nitin singh

  • NA
  • 19
  • 2.9k

need to get 15 years back date from datetime

Jan 10 2019 5:58 AM


I have below 2 dates(yyyymmdd format) with which i have to work with


Date1: 2019-02-01
canceldate= 2004-02-28
 
Now i have select all the records for whome Dte1-canceldate>=15
 
i used DATEDIFF(YEAR,canceldate,Date1).
Using this command the above condition is satisfied considering difference in year. But actually canceldate 2004-02-28 <15 year and record with canceldate shud not have been selected.
 
Please let me know how can i correct the above issue

Answers (3)