MSSQL 2008.
I mean I can do in with when but how can I simulate a nullorwhispace when creating a view?
Currently I'm doing it this way. Is it acceptable?
Not I'm also breaking a nvarcahr substring to date the issue is that if I use just ISNULL, any empty value '' will produce '1900-01-01' but I need it to produce null.Code:Create View SELECT... case when person_suburb ='' THEN NULL ELSE ISNULL( Cast( SUBSTRING(person_suburb,Charindex('FD',person_suburb)+5,8) as date),null) END as FirstDate FROM ...




Reply With Quote