Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'All' or one of Parameters

Status
Not open for further replies.

kutoose

Technical User
Sep 11, 2002
169
US
In my parameter selection I have to create 2 parameters which can have 'All' values or either one of selected values.How can this be accomplished ? What code should be done in select expert

I am using Crystal 10

kutoose@yahoo.com
 
Are the parameters multiple value parameters? If so:

(
If not ("All" in {?Param1}) then
{Table.Field1} in {?Param1}
Else If "All" in {?Param1} then
True
)
and
(
If not ("All" in {?Param2}) then
{Table.Field2} in {?Param2}
Else If "All" in {?Param2} then
True
)

If they aren't multiple value params:
(
If {?Param1} <> "All" then
{Table.Field1} = {?Param1}
Else If {?Param1} = "All" then
True
)
and
(
If {?Param2} <> "All" then
{Table.Field2} = {?Param2}
Else If {?Param2} = "All" then
True
)

-dave
 
Hello,
I need this for 13 parameters, is there an **easier** way to code this?
 
If your parameters are single value parameters, then you could maybe get away with something simpler, but you should check 'Show SQL Query' often to see if you're getting SQL pass-through:

({Table.Field1} = {?Param1} or {?Param1} = "All")
and
({Table.Field2} = {?Param2} or {?Param2} = "All")
and
({Table.Field3} = {?Param3} or {?Param3} = "All")
and
..........

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top