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)
 Select

Author  Topic 

mahimam_2004
Starting Member

40 Posts

Posted - 2007-01-17 : 14:04:09
Hi,

In my Sqlserver Reporting services report i have a multi value parameter for example, Species->Human,Animal,Select All.Multivalued parameter display available values in addition display 'SELECTALL' option.If the user clickon SelectAll, The parameter is send to the stored procedure in this way 'val1,val2,val3...'.
SelectAll is a UI concept.But here the problem is:When the user Selects Animal I need to show only Aniaml related cases.When Human selected, I need to show 'Human' related cases.If both 'Humna','Animal' selected only show cases of both Animal and Human types.When the User selects 'Select All' I need to show Both Human, Animal and SpeciesID IS NULL also.

But SelectAll sending only 'Human' and 'Animal' for SelectAll.

In my stored procedure
@SpeciesCount =How many values user selected from the Multi valued parameter.

IF(@SpeciesCount=(Select Count(*) From paSpecies))

Set @Species=Null

and Where condtion is

Where (@Species IS NULL Or ('%,'+@Species+',%' like '%,'+cast(ps.Name as nvarchar(max))+',%'))

Here the problem is if the user selects only 'Human' and 'Animal' (Which seems to be equal to 'SelectAll') not 'SELECTALL', The procedure giving the result of PaSpeciesID Null,Human,Animal s.For 'SELECT All' How we set the condition.

Thanks in advance



Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2007-01-17 : 19:01:59
Can you please clarify, your post is very hard to follow. Please post your entire stored procedure so I can make more sense of this.
Go to Top of Page
   

- Advertisement -