Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 CASE WHEN with ISNULL [RESOLVED]

Author  Topic 

Pace
Constraint Violating Yak Guru

264 Posts

Posted - 2007-11-21 : 10:10:52
Hello,

I am making silly mistakes with this line. I can use both functions, I have just never had to use the two together and its not looking right for one and not causing me an error for two. Can someone help me out please?

I know it must look silly and stupid I do apologise.

CASE WHEN ISNULL(Parameters.Add4, '') THEN Parameters.Add4 = '' ELSE Parameters.Add4 & ', ') END,


edit: oops! forgot my error;
Msg 4145, Level 15, State 1, Line 81
An expression of non-boolean type specified in a context where a condition is expected, near 'THEN'.


"Impossible is Nothing"

Dallr
Yak Posting Veteran

87 Posts

Posted - 2007-11-21 : 10:15:41
Try the following:
CASE WHEN Parameters.Add4 IS NULL THEN '' ELSE Parameters.Add4 & ', ' END
Go to Top of Page

Pace
Constraint Violating Yak Guru

264 Posts

Posted - 2007-11-21 : 10:22:00
quote:
Originally posted by Dallr

Try the following:
CASE WHEN Parameters.Add4 IS NULL THEN '' ELSE Parameters.Add4 & ', ' END



Of course! Thank you.

Good day today

"Impossible is Nothing"
Go to Top of Page
   

- Advertisement -