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

How to use selection parameter in Title of report 5

Status
Not open for further replies.

mrslockett

Technical User
Dec 4, 2001
3
US
I have created a report which prompts the user for a date range to include on the report (by using a date range parameter in the select expert). I would also like this date range to appear in my title, to indicate to the reader of the report which period was selected by the user. How would I accomplish this?
 
See my FAQ on common formulas ( faq149-243 ). There is a formula that shows how to capture 'range' parameters. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
You could use:

"The date range is" & minimum({?date}) & " to " &
maximum({?date})

This automatically converts date to text object.

When they choose no upper or no lower bound for their selection, it will not appear in this title formula, it will just show a blank.

Have you considered using a start date parameter and an end date parameter instead of the range so you don't have to worry about the no upper or no lower bound selection happenings.

 
Thanks. OK, now one more piece of info. The field I am using is actually a date time field. I can use the formula but the date range appears with the date and time. For example, the title says

From: 11/04/00 12:35:00 PM to 12/04/01 12:35:02 PM

How can I convert this to display only date?
 
This is what I used to get the date range to appear in my page header. Try it and see if it works for you:

if Not IsDate(ToText(Minimum ({?Parameter}))) then
//no lower bound
"All Days through " + ToText (Maximum ({?Parameter}), "MM/dd/yy")
else if Not IsDate(ToText(Maximum ({?Parameter}))) then
//no upper bound
ToText (Minimum ({?Parameter}), "MM/dd/yy") + " through Current Date"
else
//both bounds supplied
ToText (Minimum ({?Parameter}), "MM/dd/yy") + " through " + ToText (Maximum ({?Expected Date}), "MM/dd/yy")

Hope this helps you!
 
make it easy on yourself, try a variation of Alleys solution:

"The date range is"+date(minimum({?date}))+" to "+
date(maximum({?date})) Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top