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

HOW TO PRINTDATE RANGE PARAMETER IN REPORT TITLE?

Status
Not open for further replies.

vsmiley

MIS
Jul 24, 2001
15
0
0
US
Greetings!

I am having a problem printing the date range that is selected as a parameter to print out in the report title. When using a string as a parameter all I have to do is place the parameter in the Report Title section and it prints out, however, this does not work for Date/Time parameters. Any help would be appreciated.

Thanks

V
 
You're getting a blank field not because it's a datetime parameter, but because it's a range.

Use a formula like:

"From " + totext(minimum({?date})) + " to " + totext(maximum({?date}))

Naith
 
Naith,

Thanks for pointing me in the right direction, however, when creating that formula it turned into a boolean operation without an option to print out the ?DateRange. Any suggestions.

V
 
Give me a little background here:

Are you trying to display in your report header the values chosen in a date range parameter, based on a parameter which is datetime, with both ends of the range with values in?

Naith
 
You got it!!!

I ask the user to enter in a date/time range in my parameter to get info specific to the parameter. What I want to print out in the Report Header is the date range they selected as a reminder to them what specific information that asked for.

I hope I didn't confuse you.

Thanks

V
 
I am still confused. Is this a range parameter? By that I mean the "Range Value(s)" radio button is selected when you created the parameter. Please advise. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Okie dokie.

The afore mentioned formula is definitely you're ticket out of here, so I'm not sure where you're going wrong.

You're creating a new formula, inserting what I posted before (changing {?date} for your parameter field name), and inserting the formula into the report title, are you?

Naith
 
Hello!
I had same problem yesterday and sorted out in this way with help of tektips
i created two formulas
@start and @end
in fist formula
my parameter was datetime
on the report i gave text object "from"
i wanted to print month name and date
i gave

stringVar mth;
If left({?@start},2) = '01' Then
mth:="Jan"+" "+Mid ({?@start},4 ,2)+" "+"-"

same with @end but i gave parameter @end and text object to
the out put was like

From Jan26-Jan30
Hope this helps!
 
I gave above formula in page header.Ithink it should work even in report header.Not sure..
 
Your situation is a bit different to V's, Simma, because you were working off've two fields. If V had two parameters a simple formula like

totext({?Date1})+ " to " + totext({?Date2})

would display

26 Jan 2002 to 30 Jan 2002

In the case of your formula, I think you made a lot of excess work for yourself. If you'd used

monthname(tonumber(left(totext({@start}),2)))+" "+mid({@start},4,2) + " - " + monthname(tonumber(left(totext({@end}),2)))+" "+mid({@end},4,2)

you would have saved yourself writing if/then/else loops for every month. [ponder]

Sorry this is shutting the stable door after the horse has bolted, but I didn't know you were doing this yesterday.

Naith
 
Naith,

Here's what I did, fortunately my parameter is named just that Date range:

totext(minimum({?Date Range})) = "-" + totext(maximum({?Date Range}))

The end result is that no errors are found but inside the parameter you see false and when I edit the formula it comes across as a boolean. Is there somewhere in Options that I can change this to Date/Time that you know of? I mean it looks like it should work but......????

Also to dgillz, the paramer is a range parameter, the user is asked to select the date/time range Upper and lower that they want data for.

Thanks to all of you including simma, you guys and your responses are greatly appreciated.

V
 
That's because you've stuck an equals sign in there.

The reason it's saying 'False' is because the literal first half of the formula doesn't equal the second half.

Take it out, and replace it with +.

Naith

By the way, Simma - you might want to leave your formula in now that you've written it. It looks a lot sexier when a manager looks at your screen. [thumbsup2]
 
Yesterday I was getting boolean too.
Naith suggested me the solution as follows
I had
mth=jan
I was getting boolean
The solution naith gave me was
mth:=jan

Hope this helps
Thanx
 
Thanks Naith!! Im not expert as you are trying to get there!!!Lot of ways to get solution.Experts like you sort easy way out.Beginners like me struggle to get there!!
Thanks for your help all the time!!
 
Naith!! I tried your formula
monthname(tonumber(left(totext({@start}),2)))+" "+mid({@start},4,2) + " - " + monthname(tonumber(left(totext({@end}),2)))+" "+mid({@end},4,2)
but getting errors
is monthname a function???
Thanx
 
Yeah it is. However, it might not be available on version 7, if that's what you're using.

Looks like your nests weren't a waste of time after all.

Naith
 
Yeah exactly!! Im using Crystal 7.0.Im using an application for my company which uses only 7.0.Im trying hard to get 8.5 on that.
Thanx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top