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

Dropping Date Range Parameter on Report 2

Status
Not open for further replies.

dbielenda

MIS
Nov 15, 2001
119
US
When I place the date range parameter on the report, it shows a blank instead of the dates I entered. I would like to see 5/14/02-5/16/02 that was selected from the drop down calendar. Why did this happen? All the other parameters show fine...

Value Type: Date
Option: Range Value(s)

Thanks!
[2thumbsup]
 
You need to create two parameters; {?Start Date} and {?End Date}, and in the Selection Expert, ensure that your datefield falls within the two parameter values.

i.e. [{?Pm-Start Date} to {?Pm-End Date}]

You could display the values of the ranged date parameter if you assigned the values to variables in a formula, but you will find that if the user enters date values which are not in the database, the returned values are confusing.

<N>
 
Oops. The syntax I gave you is actually the field I used for testing displaying the two fields in the report header in a text field.

The correct Selection Criteria should be:

{Your.Date_Field} in {?Start Date} to {?End Date}

Sorry if the previous example misled you.

Naith
 
Thank you for the help. I just discovered a new way to do it. I have the same value type (Date) and option (Range Value). Then I created a formula and dropped this formula onto my report:

ToText(Minimum({?Date Range})) + &quot;-&quot; + Totext(Maximum({?Date Range}))

And it displays: 5/14/02-5/16/02.

I suppose either way is good.
 
And to show multiple date ranges from a parameter:

ToText(Minimum({?Date Range}[1])) + &quot;-&quot; + Totext(Maximum({?Date Range}[1]))

Where [1] is the index of the array of date range parameters.

Here's how you obtain the number of elements in the parameter array:

WhilePrintingRecords;
Local Datevar Array InputNum := {?My Range Dates};
Local NumberVar ArrayLength := Count (My Range Dates);

Now you can loop through and pull them.

-k kai@informeddatadecisions.com
 
Well you get the idea, I had a typo in there...

WhilePrintingRecords;
Local Datevar Array MyRangeDates := {?My Range Dates};
Local NumberVar ArrayLength := Count (MyRangeDates);

BTW, I assign the parameter to a local array in this fashion for reusability, I just replace the field and the formula works.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top