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

Parameter with Multi Numeric Range

Status
Not open for further replies.

chrismcaniff

Programmer
May 18, 2006
8
0
0
US
Hi,

I am trying to make a paramter with following choices

Category Range Parameter

Mens (cat number in inventory.cat table is 0 to 9)
Womens(cat number in ineventory.cat table is 10 to 19)
Kid's (cat in inventory.cat is 20 to 29)

Main categories (Men's, Women's, etc) have no link to the database tables other than the above number ranges.

Some or all of these Categories may be selected

Having great trouble with how to do this, any help is much appreciated

Thanks

Chris

 
So whats the problem? Creating the parameter? The record selection formula? The default values of the parameter?

Please state the problem. Also please include your version of crystal and the database and connectivity used.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I would make this a string parameter {?Category} with options: Men, Women, Kids. Then in your record selection formula, use:

numbervar i;
numbervar j := ubound({?Category});
numbervar range array x;
redim preserve x[j];

for i := 1 to j do(
x :=
(
Select {?Category}
case "Men" : 0 to 9
case "Women" : 10 to 19
case "Kids" : 20 to 29
));
{table.catno} in x

-LB
 
Hi,

I am using Crystal XI with ODBC RDO connection

Having trouble with the parameter selection formula

I want to be able to select any combination of Men, Women, Kid's and have the formula select the corresponding numberic category in the inventory table.

I did make a string parameter with values of Men, Womens and Kid's. I tried the formula that LB suggested above but get this error

An array is required here

on this part of the formula:

numbervar j := ubound({?Category});



 
Okay
I got rid of the above error message in my post by setting my string Category Parameter to Allow Multiple Values: True

Other Category Parameter options are
- Allow Custom Values: False
- Allow Discrete Values: True
- Allow Range Values: Fales

I now get an error "the word else is missing" right after the

case "Kids" : 20 to 29
));

Any suggestions ?
 
Okay I resolved my above error message by adding a
Default statement after the last case which got rid of the error message

One last problem is I just realized my inventory.catno is a string field and not a numeric field as I originally thought.

So above formula by LB doesn't work since it is expecting inventory.catno to be numeric and not a string.

How would I revise LB's forumla to account for my category values in the inventory table being strings i.e. "10" and not numeric i.e. 10.

Any help is much appreciated

Chris
 
Change the last line of the formula to:

val({table.catno}) in x

The select case statement does not always require a default value (this might be a version issue), but in versions earlier that 9.0, it requires an extra close paren at the end, even though there is no corresponding open paren.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top