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!

Daily Reports 1

Status
Not open for further replies.

McChops

Technical User
Oct 1, 2002
29
AU
Hi,

I'm relativley new to Crystal and have been put in charge of daily reports. I have a large report which is made up of many subreports and is run daily (in the mornings to report on yesterday's data).

The report has a date parameter which requires the user to enter a start and end date. At present the default start and end date is the Current Date, and this forces the users to manually re-adjust the start and end date of every sub report, within the report, so it is extracting yesterday's data.

To make life easier for the users it would be a lot easier if the default date was the current date -1 (ie yesterday).

I understand a suitable formula for this problem would be
DateAdd("d", -1, CurentDate) however I can't seem to work out where to place this formula, so it will take effect.

Any help would be appreciated. I'm new to forums and hope this question has been posted in the right area. Please let me know if my question should be posted elsewhere.

Cheers
 
Lo McChops,

Goto this thread i had a familiar question+

thread149-371297

good luck
 
I see that you were pointed to an earlier thread of mine along these lines, but it may be overkill for your requirements.

You could skip the parm and just place the following in the record selection criteria:

{MyTable.MyField} = currentdate-1

Or as the thread alludes to, you could prepopulate a parm with 'Yesterday' and 'Custom Date Range', and have another parm which takes in a date range.

Now place an If in the record selection criteria which says:

If {?Prepopulatedparm} = 'Custom Date Range' then
{MyTable.MyField} = {?MyDateRangeParm}
else
{MyTable.MyField} = currentdate-1

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top