In a recent report, I needed to return data based on a date range
selected. That's easy enought to put in... you just create a new
Parameter field, set the type to "Date" and make sure the "Allow range
vales" option i set to true. With the parameter field created, you need
to add a record select formula that reads like this...
(TABLENAME.DATEFIELD) = {?DateRange Parameter)
...and all the records returned will be in that date range.
I
also needed to display that range value in the report, which took a
little digging to figure out. All you need to do is to create a Formula
field with the following code:
WhilePrintingRecords;
DateTimeVar date1;
DateTimeVar date2;
date1:=Minimum({?DateRange Parameter});
date2:=Maximum({?DateRange Parameter});
totext(Date(date1)) + " and " + totext(Date(date2)) Then
all you need to do is slap that formula field somewhere on the report,
and it will display the date range selected in the parameter.
Thanks for reading! I hope you found this helpful!
No comments:
Post a Comment