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!

Startdate and Enddate in Database

Status
Not open for further replies.

cestonina

Programmer
May 25, 2003
30
0
0
SG
Hi,

Just would want to ask how can I put in formula the start date and end date of my report based from the database fields (datetime)? Not sure if its OnFirstRecord function?

Basically I'm in charge of doing the reports only. I have no control over the database fields. My report consists of a chart, datetime vs data (raw). The data in the DB values varies each day. It's filled up by another group so there would be no parameters defined in my crystal reports. Just need to "chart" the entire data for each day (need to generate it once a day after office hours).

My reports are now finished, but I would like to add a range in my report header that would consist of the start date and end date in the database, so people who read it will know of the date range for each report.

example: The data in the database varies each day, see sample below.

1st day:
10/01/04 87
10/02/04 76
10/03/04 90
etc.

2nd day:
06/23/04 54
06/24/04 103
06/25/04 99
etc.

and so on...
Thanks in advance.

Regards,
Chris
 
The start date and end date in the database."

Would that mean the minimum and maximum date of some field in a table?

Supplying example data is great, had you supplied example output then it might have clarified.

You can get these using formulas such as:

minimum({table.date})

maximum({table.date})

If you need them for a specific group in your report, use:

minimum({table.date},{table.group})

-k
 
Your example is unclear. Are you trying to show the start and end dates of potential date ranges? If so, it looks like you are defining the ranges as 100 days. If your data at the end of the day is available immediately for reporting on, then use the following for your record selection formula:

{table.date} in currentdate - 100 to currentdate

If the data won't be available until the next day, then use:

{table.date} in currentdate - 101 to currentdate-1

To display the date range in the report header, use a formula like:

"Report Period: "+totext(currentdate-100,"MM/dd/yyyy")+ " to " + totext(currentdate,"MM/dd/yyyy")

-LB
 
Hi Guys,

Thanks for the quick reply. I believe the minimum and maximum functions on the dates should do the trick :)

Cheers,
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top