I am running a query to get data from the past 60 days and BEYOND. So basically I am trying to capture anyone whose installdate is Today - 60 days and beyond. And I should be getting data whose installdate is 6/12/2021 and beyond. But the query is returning data with the Month of July also. While I am expecting all data on and before 6/12/2021.
I tried the following values in WHERE CLAUSE, but none of them works... Any suggestion, please?
- InstallDate >= convert(date, getDate()-60)
- InstallDate >= DATEADD(day,-60, GETDATE())
Thanks.
Convert(date, InstallDate) <= Convert(date, getDate() - 60)
and then do>=
for when you want 60 days or less prior to today(e.g. the last 60 days worth of data).