select top 10 (DATEPART (year, ss.[dateTime]))
from states ss
where ((DATEPART (year, Cast(ss.[dateTime] as date))) >= (DATEPART (year, 2021)))
This returns me data with 2020, 2019 as well why?
The type of dateTime column is DATETIME and stores values like 2020-10-17 08:20:30.033.