Link to home
Start Free TrialLog in
Avatar of JonYen
JonYenFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Return empty string instead of NULL in query

Hi Experts

I am running a query to get return the file name of a picture.    It should either return the filename.jpg or be an empty string but when the record has no picture because the picture has been deleted it returns a NULL value rather than an empty string.  Even though I am replacing using NULL as criteria and return '' I still get NULL in result set.   Is there a way around this?

Thanks
Jon
case T0.[PicturName]
when NULL THEN ''
else T0.[PicturName]
END 'Picture',

Open in new window

Avatar of Andrew Crofts
Andrew Crofts
Flag of Ukraine image

select isnull(T0.[PicturName],'') as 'Picture' from yourtable
 
ASKER CERTIFIED SOLUTION
Avatar of Andrew Crofts
Andrew Crofts
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JonYen

ASKER

worked great thanks.