Modify SQL Nested Case Statement

jamesh1031
jamesh1031 used Ask the Experts™
on
I currently have this: CASE WHEN (ChargeDays-TimeToSubtract) > 9 THEN 1
      WHEN ChargeDays-TimeToSubtract = 29 THEN 2
      WHEN (ChargeDays-TimeToSubtract) > 30 THEN 3
      ELSE 0 END

I want to replace the THEN 1,2 and 3 results with something like (N'<img src="graphic1.gif"></img>') i also need to do a convert I think. Thank you.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Database Consultant
Top Expert 2009
Commented:
CASE WHEN (ChargeDays-TimeToSubtract) > 9 THEN 'N'''' '
      WHEN ChargeDays-TimeToSubtract = 29 THEN 'N'''' '
      WHEN (ChargeDays-TimeToSubtract) > 30 THEN 'N'''' '
      ELSE 0 END

Author

Commented:
I am getting a "Conversion failed when converting the varchar value  'N''<img src="graphic1.gif"></img>'' '  to data type int"
What aneeshattinqal stated is correct.

Try this:
ELSE '0' END

Author

Commented:
Thank you
You're welcome

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial