SP Code

SP Code

 

  

Ok - real easy question, I'm sure - but I can't sort it out.

Below is a code snippet where I want to turn this into a SP, and pass in the
value of @ActivityChoice. I've hard coded the value below to be 'RC' but I
want it to have more values dependant on what was passed.

It can be any combination or just one of the following: RC, I, RI, FO.

DECLARE @ActivityChoice CHAR(2)
SELECT @ActivityChoice = "RC"
--Want to pass in value of @ActivityChoice
--example values could be RC, I, RI, FO

select enfact_stat_code
from enfact
where enfact_stat_code in (@ActivityChoice)

Right now it returns:
enfact_stat_code
----------------
RC
RC
RC
RC
RC
RC
RC

A sample output when I get it working would be, if I passed it 'RC', and
'FO' and 'I"
enfact_stat_code
----------------
FO
FO
RC
I
I
RC
FO
RC
RC
RC
I
FO
RC
RC


__________________________
Joe Horton
Database Developer / Software Engineer
WISHA/Legal Services Software Development
Department of Labor and Industries
Voice (360) 902-5928 fax (360) 902-6200

MS Sql Server LazyDBA home page