$ 0 0 Try this: casewhen v.value is not null and rtrim(ltrim(v.value)) <> '' and isdate(v.value) = 1 then try_Convert(varchar(20),v.value ,100)else v.value end