Forum Discussion
kpan8
Jan 21, 2025Copper Contributor
Questions about converting date
I used a function to convert character to date and then do a calculation using datediff. ,CONVERT(DATETIME,CONVERT(CHAR,cs.LastCourseActivityDate)) AS Last_Course_Activity_Datetime ,case ...
HolgerRachut
Jan 22, 2025Copper Contributor
can you use TRY_Convert instead of convert? https://learn.microsoft.com/de-de/sql/t-sql/functions/try-convert-transact-sql?view=sql-server-ver16
That should deliver NULL Values for non convertible cs.LastCourseActivityDate values und you can start the find the values that causes the error.