The reason for the problem is in
DATEPART function returns an integer, so it is better to compare to
YEAR function by itself shouldn't change anything as it is just wrapper on
This should work:
DATEPART(YEAR, s.ContractYear__c) AS ContractYear__c
WHERE DATEPART(YEAR, s.ContractYear__c) = 2020
However, I also tested it with a string date on my instance and it was working correctly for the
DateJoined field of
_Subscribers data view.
Are you testing the query with Query Studio or SQL Query Activity? If the latter, are you cleaning the Data Extension between tests? Maybe those are records from previous runs with the new ones being added/updated?