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

Formula or Function that calculates Static Date

Status
Not open for further replies.

hhiebert

MIS
Feb 28, 2003
25
0
0
CA
I need to add a formula to my report that informs the end-user what date range the report is reporting for. ex. 20Mar2003 - 20Mar2003. Generally, all reports for the 20th get run early in the morning on the 21st. So my thinking is to use the Special Field 'DataDate' and subtract one day from it. This would remain static then right? What I mean is, if the report were to be opened 3 months down the road the field would still show the value 20Mar2003 even though it's June. Does anyone know of another way of getting these date values?

Secondly, when I try to create a function using the DataDate I get a message saying that "This function cannot be used within a custom function". Help...anyone???
 
Assuming you have a date range parameter, use a formula such as:
-----------------------------------------------
"From: " + ToText ( Minimum ( {?Your_Date_Param} ) ) + " To: " + ToText ( Maximum ( {?Your_Date_Param} ) )
-----------------------------------------------

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Actually, I didn't want to use a date parameter since the data is not dependant on it. I just need it for fulfill reporting standards in stating the reporting range....which would be the database date.

Am I better off using a date parameter for the report?

hh-
 
In that case, try the following:
-----------------------------------------------
"From: " + ToText ( Minimum ( {Date_Field} ) ) + " To: " + ToText ( Maximum ( {Date_Field} ) )
-----------------------------------------------

Where {Date_Field} is a date column in your database.

This would show the earliest and latest date in the records selected for the report.

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top