Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Date Range Parameter Title Formating When Using the Range of Values Option


I have created a Date Range parameter that is using 1 field and I have specified the "Allow Range of Values" option in the parameter creation dialog.

Of course when you want to allow the date range to appear on the title of the report I have to create a formula to tell Crystal what the minimum and maximum of the range is that the user has selected.

The formula looks like this.....

"Orders Placed Between " & IIF(HasLowerBound({?dayrange}), Totext(Minimum({?dayrange})), "beginning of time") & " and " & IIF(HasUpperBound({?dayrange}), ToText(Maximum({?dayrange})), "into the future")

When you drag this formula onto the report the title will show "Orders Placed Between 10/1/2008 12:00:00AM and 12/25/2008 12:00:00AM". With 10/1/2008 12:00:00AM being the minimum value and 12/25/2008 12:00:00AM is the maximum value.

My question is how can I format the date string to read just the date without the time? For example it should look like this 10/1/2008 on both dates. I tried creating a formula to use as a parameter and well you can't use formulas to create parameters.

We are getting the full timestamp because that is how its coming over from sql server 2005.

I'm using Crystal Reports XI-R2 with service pack 4

Former Member
Former Member replied

Hi Levi

Here is the formula

"Orders Placed Between " & cdate(IIF(HasLowerBound({?My Parameter}), Totext(Minimum({?My Parameter})), "beginning of time"))

& " and " & Cdate(IIF(HasUpperBound({?My Parameter}), ToText(Maximum({?My Parameter})), "into the future"))

I hope it works fine.


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question