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

Show a title like "{first date} to {last date}" refering to dates in the report 1

Status
Not open for further replies.

freakygreeneyes

Technical User
Sep 23, 2013
3
Hi Fellows

I just started using crystal reports and am really not familiar with it jet. I've already programmed in VBA and therefore I prefer the Basic-Syntax but I should also be able to handle a Crystal-Syntax Solution.
My target:
I want to set a title in a report that says whats the date of the first list entry to the date of the last list entry. The dates are measured as data base fields.
If possible it would be great, if the "last date" part could be changed via parameters into any choosen date.
Thanks a lot for your help!
Greets
freakygreeneyes
 
Might try the MAXIMUM and MINIMUM functions in separate formulas. Two examples:"

Code:
//formula @FirstDate
minimum({database date})

Code:
//formula @LastDate
maximum({database date})
 
Hey pmsawyer

Thanks a lot, that works perfect for me!
Two more questions:
1. How do I format the so shown dates? (Their now shown like "dd.MMMM.JJ 00:00:00" but I only need the date, not the hour.
2. Is it possible to modify the @LastDate Formula, so you could choose to eighter show the last date or one you enter yourself?

Thanks a lot!
Greets
 
Hey again!

I solved it myself.
Here you go:
Code:
If {?DateParameter} > maximum ({DatabaseDate})
Then " Vom "+toText(minimum({DatabaseDate}), "dd. MMMM yyyy")+"  bis  "+ToText(maximum({DatabaseDate}), "dd. MMMM yyyy")
Else " Vom "+toText(minimum({DatabaseDate}), "dd. MMMM yyyy")+"  bis  "+ToText({?DateParameter}, "dd. MMMM yyyy")

Maybe its helpful for someone else.

Greets
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top