• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 708
  • Last Modified:

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

0
JonYen
Asked:
JonYen
  • 3
1 Solution
 
Atdhe NuhiuCommented:
select isnull(T0.[PicturName],'') as 'Picture' from yourtable
 
0
 
Atdhe NuhiuCommented:
select isnull(T0.[PicturName],'') as 'Picture' from T0
0
 
JonYenAuthor Commented:
worked great thanks.  

0
 
Atdhe NuhiuCommented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now