select staffid, leaving_d from rcmsql4.[SSTRESS].[dbo].[vwGetStaffDetails] where leaving_d is not null and try_cast(leaving_d as datetime) is null order by staffid;For earlier versions, you can check using isdate instead of try\_cast:
select staffid, leaving_d from rcmsql4.[SSTRESS].[dbo].[vwGetStaffDetails] where leaving_d is not null and isdate(leaving_d) = 0 order by staffid;
19 People are following this question.