Link to home
Start Free TrialLog in
Avatar of David Onken
David OnkenFlag for United States of America

asked on

SQL case if field has a space?

Hi. The code below works. The problem that I have is that there are some parts that have a space in the Revision_ID field. If there is a space I would like it to put REV. - in the field. How can I use a case to filter these?
CASE(REVISION_ID)
 
              WHEN NULL THEN ' REV. -'
 
	      ELSE ' REV. ' + REVISION_ID
          
              END

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of reb73
reb73
Flag of Ireland 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
SOLUTION
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 David Onken

ASKER

Thanks it is now working when there is a space. I still need to refine it because if Revision_ID is null then the result is Null also. Any ideas?
I believe you tried my solution, which won't quite work as WHEN NULL doesn't quite work as expected..

Try Brandon's solution (24110103) which should work..
Thanks for your help today.