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

Format Date Parameter

Status
Not open for further replies.

mfroggie

Vendor
Jan 22, 2002
44
US
I have a report that has a Date Range Parameter, the dates have to be entered yyyymmdd. I need to put the beginning period MMMM yyyy thru MMMM yyyy into the header and cannot seem to get the correct formula. I have done Minimum and Maximum but had to change date totext to get the MMMM yyyy to format correctly so now I get the Min and Max sorting by the text rule and not the date rule. Am I going down the right path or should I be working this another route. I am using CR 7 for this report.

Thanks for any help.

Mfroggie
 
hi

create 2 parameter
{?BeginDate}and {?EndDate}
when you create each one do not link to any table on as date
make sure you ask the user to enter date format

ex:
Prompt text
Please enter begin date mm/yyyy
make sure you have yor date field formated to mm/yyyy
in your report select the date field and click select expert and filter is between and there you will see your parameter between {?BeginDate}and {?EndDate}

cheers



pgtek
 
You don't need two parameters, nor do you need anything tricky to display the results, just don't use the display formula as the element by which the data is sorted.

Just use the totext against the minimum and maximum for display purposes only.

There are numerous headers in a Crystal Report (Report, Page, Group), please post specifics if you need additional help.

-k
 
The report is a crosstab in the RH and the Title above the crosstab is what I am working on so it is in the RH as well. I have a formala:
ToText({@FirstPeriod}) + " thru " + ({@LastPeriod})

Then the @FirstPeriod formula:
Minimum({@fmtMthYr})

Then the @fmtMthYr formula:
ToText({@fmtDate}),"MMMM yyyy")

And the @fmtDate formula:
pwFormatDate ({OESHDT.TRANDATE})

Then naturally my @LastPeriod is the same except for Maximum.

Have I gone way overboard? My results, since Min and Max are eventually formatted to text in the ToText step, automatically sorts for string fields returning the first member of group alpahbetically ie: for date range entered as 20020601 to 20030531 the header text reads April 2003 thru September 2002 since April comes before September alphabetically.

Thanks

Mfroggie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top