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

Parameter Field range value issue

Status
Not open for further replies.

J33

IS-IT--Management
Apr 8, 2019
14
0
0
FI
Hi, I am using CR XI and a OLEDB connection. I want to use a Parameter Field allowing multiple, discrete and range values. Now I am facing a small issue with the range:
[ul]
[li]If I select the range: Rows 1-9 from an offer request - I get rows 1-16 (all rows)[/li]
[li]If I select the range: Rows 1-10 from an offer request - I get rows 1 and 10[/li]
[li]If I select the range: Rows 1-3 from an offer request - I get rows 1-3 and 10-16 (all rows)[/li]
...and so on. However, adding values 1, 3, 6, 7 works.
[/ul]
The database field is a string value and therefore I need to have the Parameter type: string
The report does fetch the row numbers via the database field and I have added the same Value field to the Parameter.

Hope there is an easy fix for this :)
 
The simplest solution would be to use a number parameter and change your selection formula to:

Val({table.row}) in {?ParameterRange}

Better yet, do a conversion of the row field to a number in the SQL expression editor, and then use that in your selection formula for more report speed.

-LB
 
Thanks for your quick answer. I am a self-taught beginner and haven't used the SQL expression editor or conversions. What I did try and surprisingly works:
1. Changed the Parameter to Number
2. Added 'Val({table.row}) in {?ParameterRange}' to the formula field
-> This changed the type to Boolean and gives True/False values in the report and does fetch the correct rows, if I set in the Select expert to "is True.".
3. Hid the formula field and added the row numbers from database fields to view the numbers instead of True values
-> Now I get the correct values with the range and/or multiple values

If this is completely wrong and needs to be changed, please let me know!

 
This is okay—you just added in another step. I meant for you to add:

Val({table.row}) in {?ParameterRange}

...to report->selection formulas->record.

-LB

 
Ok, thank you for the help! I could not figure this out without your advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top