I guess. The date is always represented as a string I have to cast.
The values are NULL, '' or longstring. The ideal would be an existing isnullorwhitespace as in .net but there is non in SQL.
Edit.
After more careful evaluation what I'm using may break sargability on an already non sargable CAST , so a more sargable select might be:
Code:case when (person_suburb is null or DATALENGTH(person_suburb) <=0) THEN NULL ELSE Cast( SUBSTRING(person_suburb,Charindex('FD',person_suburb)+5,8) as date) END as Firstdate




Reply With Quote