I have a mssql statement to select last years data. the statement is:
Select Count(LeadID) ld From Leaddata where year(CapptDate) = DATEADD(YEAR, -1, getdate())
According to my data, 2018 has 1 as an answer, 2017 has 76 as an answer. when i plug in the actual years ie '2017' in place of the dateadd, i get the proper results. The above statement should return 76 but it returns zero.