Home Forums SQL Server 2017 SQL Server 2017 - Development 5 years or older RE: 5 years or older
HanShi
SSC-Dedicated
Points: 33506
More actions
February 20, 2018 at 5:09 am
#1980414
Create your WHERE something like:
WHERE [your_date_column] > DATEADD (year, -5 , GETDATE() )
Try to not wrap the function around your column so the query can still use any indexes on that column.