cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

All,

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Thanks

Former Member
0 Kudos

Wow that worked great, I simply plugged in my parameters and it worked flawlessly.

I was also going along and trying to follow what exactly you did, and it looks like you were using CDate which I didn't even think about using.

I know this has helped me, and I can guarentee that there is a group of people out there that will benefit from this as well.

You get the gold star for today.

Thanks

Answers (0)