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

display month of daterange? 2

Status
Not open for further replies.

Tracey

Programmer
Oct 16, 2000
690
NZ
hi

i have a report which has a daterange parameter.

this report is run at the month end, for the previous month.

Is it possible to extract the month and year to display in the header? Or even the start date and end date of the daterange?

Im thinking probably not, but before i change the report to want a "month" value, i'd like to know for sure.

[cheers]
 
You can extract your beginning and ending date by using the minimum or maximum funtion. The following will give you "2 - 2003" for a date dange of February

totext(month(minimum({?your.date.range.parameter})),0)+" - "+ totext(year(minimum({?your.date.range.parameter})),0)

Mike
 
totext(month(minimum({?daterange})),0)+" - "+ totext(year(minimum({?daterange})),0)

tried that but i get this error:

the summary / running total field could not be created
 
Check to see if your parameter is set as a range and not a discrete value? Mike
 
Just put minimum({?daterange}) in your formula.. you will get a date back.. you can format the date to display any way you want to.

Lisa
 
If the minimum is not working as part of the totext function, it won't/shouldn't work in the "minimum({?daterange})".

The reason I asked about the discrete vs range is when I tested it as a range pameter, it worked fine, but if I change it to a discrete parameter it gave me the "summary/running total" error.

Please post your record selection formula as to how you're getting last month's records.
Mike
 
MonthName(Month(minimum({?daterange}))) + ToText(Year(minimum({?daterange})))

works fine and will do me for now.

[cheers] all

 
dont spose either of u could tell me how to format the year value so it doesnt look like:

2,003.00

when it is presented from that formula?
 
Add the stuff in bold. It should get rid of the "," and ".00"
ToText(Year(minimum({?daterange})),0,"")
Mike
 
ToText(Year(minimum({?daterange})),0,"")
Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top