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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameters

Status
Not open for further replies.

Bunting

MIS
Joined
Mar 19, 2002
Messages
50
Location
GB
I am using Crystal Reports XI.

I have a parameter in the select expert as follows:
"@Tel Status" = (?Parameter. The value of which are either 1 or 0 depending on whether an account has a telephone number or not.

This gives users the ability to select only those accounts with telephone numbers or those without.

Is there a way I can modify the select expert which gives them a third option so that they can also select "all" accounts regardless of whether it has a telephone number.

 
Create a formual field called @TestOK saying something like
parameter = 2 or @Tel Status" = (?Parameter

In your selection, say @TestOK = true, or just @TestOK. (These are tests for boolians, formula fields not beginning with 'IF'). Then you get both if you enter 2, otherwise enter 1 or 0.



[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Sharing what's in @tel status would be useful.

Generally one would create the defaults for the parameter with descriptions and only show the descriptions, that way the user can select from a friendly prompt, rather than a 1 or 0. This means that one of the options would be -999 or some such, and then base your record selection off of that:

(
If {?MyParm} <> -999 then
{table.field} = {?MyParm}
else
If {?MyParm} = -999 then
true
)

Not sure why you need a formula involved.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top