Tuesday, March 26, 2013

Crystal Reports : Ranged Parameters and their values

If you are using a date parameter that is Ranged (i.e. a single parameter field that prompts for a starting and ending date), you will probably want to display these dates on the report. This helps prevent confusion as to what data is included in the report. To do this, we will need to create two formula fields, one for the starting date and one for the ending date. The formula fields will use the Minimum and Maximum Crystal functions.

For this example, our parameter field is called {?DateRange}

Formula field #1 (Starting Date) : Minimum({?DateRange})
(Pulls out the minimum value of our range)

Formula field #2 (Ending Date) : Maximum({?DateRange})
(Pulls out the maximum value of our range)

No comments: