Home All Groups Group Topic Archive Search About
Author
18 May 2006 8:46 PM
Justin
CASE(@CustomText)      WHEN NULL THEN 'Status changed to ' +
@StatusDescription
                                         ELSE @CustomText + ' ' +
@StatusDescription END


Now, @CustomText is either null or has value.  WHEN NULL does not work.  How
do i get it to work?

Author
18 May 2006 8:51 PM
Tibor Karaszi
Already replied to other post.

Show quote
"Justin" <jus***@hotmail.com> wrote in message news:evOIVwreGHA.2456@TK2MSFTNGP04.phx.gbl...
>
> CASE(@CustomText)      WHEN NULL THEN 'Status changed to ' + @StatusDescription
>                                         ELSE @CustomText + ' ' + @StatusDescription END
>
>
> Now, @CustomText is either null or has value.  WHEN NULL does not work.  How do i get it to work?
>
Author
18 May 2006 8:53 PM
Mike C#
CASE WHEN @CustomText IS NULL THEN ... END

or just use COALESCE

COALESCE(@CustomText + ' ' + @StatusDescription, @StatusDescription)

Show quote
"Justin" <jus***@hotmail.com> wrote in message
news:evOIVwreGHA.2456@TK2MSFTNGP04.phx.gbl...
>
> CASE(@CustomText)      WHEN NULL THEN 'Status changed to ' +
> @StatusDescription
>                                         ELSE @CustomText + ' ' +
> @StatusDescription END
>
>
> Now, @CustomText is either null or has value.  WHEN NULL does not work.
> How do i get it to work?
>

AddThis Social Bookmark Button