JonYen
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
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',
select isnull(T0.[PicturName],'') as 'Picture' from yourtable
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
worked great thanks.
thanks