If you try this code you will see that when you convert it to varchar it does not equal the string you are comparing it to:
declare @Startdate as datetime
set @Startdate='1900-01-01 00:00:00.000'
select CONVERT(VARCHAR, @StartDate)
You want to compare the datetime types. And you need to output the date as a varchar because you also want to output 'date not set' which is not a date. You can't conditionally output a different type... only one or the other can be the type of your case statement.
So you need to swap the date/varchar conversions in your expression:
ISNULL(
CASE WHEN CONVERT(DATE, [TB_EVNTCERT].StartDate) = '1900-01-01 00:00:00.000' THEN
'date not set'
ELSE
CONVERT(VARCHAR, [TB_EVNTCERT].StartDate, 25)
END, '') AS expirydate,
DATETIMEtype, you could simplify to something likeCASE WHEN [TB_EVNTCERT].StartDate = 0 THEN ... ELSE ... END