Re: CHARINDEX

Re: CHARINDEX

 

  

Charles,

The result_expression after THEN in a CASE statemement

how can I return a expression with a variable appended to it? This is a
querry inside ASP. Code is below; selectedGroupID is actually a variable and
in the else part I'd like to concatenate a comma into it.

"CASE CharIndex(AlternateGroup, ',') " &_
" WHEN NULL THEN 'selectedGroupID IN (AlternateGroup)' " &_
" ELSE 'selectedGroupID' & ',' & 'IN (AlternateGroup)' " &_
"END ) .... "


Daniel



"Long, Charles (EHUK)" wrote:

> Returns zero
>
> > -----Original Message-----
> > From: Daniel Vaz [SMTP:[Email Address Removed] > Sent: Thursday, September 11, 2003 1:03 PM
> > To: LazyDBA.com Discussion
> > Subject: CHARINDEX
> >
> > Hello everyone,
> >
> > what does charindex return when an expression is not found in another?
> > (Not a case of exp1 or exp2 being null). Will that be -1 or is it still
> > NULL? BOL doesn't say anything
> >
> > thanks.
> >
> > Daniel
> >
> >
> > ---------------------------------------------------------------------
> > TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> > To unsubscribe, e-mail: mssqldba-[Email Address Removed] > For additional commands, e-mail: mssqldba-[Email Address Removed]MS Sql Server LazyDBA home page