Link to home
Start Free TrialLog in
Avatar of LCNW
LCNWFlag for United States of America

asked on

Check All Available Combinations of Parameter in DataSet

I have 4 parameters for a report. Is there a quick way to tell the dataset to check for all available combinations of the 4 parameters?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of DcpKing
DcpKing
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LCNW

ASKER

So this will handle the filtering of all possible selected combinations of the 4 parameters?
Not as such ... I was just offering a template. The stored procedure will be rather more complicated and you'll have to build in parameter to the report. Do you know how to do these things, ?

This is a YouTube intro to adding parameters to a report. As for the code in the query, you'll need to be somewhat more specific.

What exactly do you mean by "all possible combinations"? If your parameters are a, b, c, & d then is it a simple combination (return values where field_a = a and field_b = b and field_c = c and field_d = d)  ?    Should there be "or" possibilities included in some way?    Should one take into account the possibility of the user not knowing a value for one or more of the parameters ?

Mike
Avatar of LCNW

ASKER

I'm good with building parameters and SPs. I built it up and am testing.  Each of my parameters has a set of values from a query, plus I added a <Select All> value via UNION.


SELECT DISTINCT Field1
FROM         Table
UNION
SELECT     '<Select All>' AS Expr1
FROM         Table AS Field1_DD

Then I choose '<Select All>' as the default value for each parameter which returns a null and loads all records.
SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LCNW

ASKER

DcpKing,

I've modified my SP to include the where clause and implemented it into my report, but upon preview I get the following:

Error converting data type nvarchar to int

I switched the parameter definitions to nvarchar and that seemed to fix the datatype issue. However, my the parameters do not seem to be applying to my report as it returns nothing.
Avatar of LCNW

ASKER

BriCrowe,

I tried the ISNULL technique but my report is still pulling in no results.
Avatar of LCNW

ASKER

I can now get data to load into the report (appears it was a datatype issue), but this has killed my <Select All> trick. My users like to have a <Select All> option in the drop down list.
Avatar of LCNW

ASKER

I think I have it all worked out. I'll report back Monday. Thank you all.
(Sorry I vanished - I had to feed the wife :)  Hope all is going well!)

Mike
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LCNW

ASKER

All combinations of the four parameters as either a value or null. As referencing combinations and permutations in mathematics.

I came up with 16 using math.
Avatar of LCNW

ASKER

You are correct about the the and/or PortletPaul.
Avatar of LCNW

ASKER

I've got it all working. I used a combination of your answers. Thank you.
Great work. Cheers, Paul