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

Restrict the Date Ranges for when the report is run

Status
Not open for further replies.

hsandwick

Programmer
Sep 10, 2001
286
US
Crystal 2008
Oracle 10G
BOXI 3.1

The report has parameters for
Month (can be 3/6/9/12 for Fiscal Quarters)
Year (can be any whole year number)
A Division

There are multiple subreports, also with date ranges, dependent on the date ranges of the main report (e.g., (1) retrieve all prior fiscal year detail depending on the year the main report is run, and (2) retrieve all current fiscal year cumulative detail from beg. current fiscal year through today).

We are dependent on historical transactional data feeds and current nontransactional data, and the quarterly feeds do not occur on the same date each quarter because it depends on when the pay dates occur.

We are scheduling the reports to run, so no problem there, we have control over those.

We are also providing one version of the report for the audience to run, and we do not have control over that. So, can we restrict the dates to run only up to today's date, and only for the last prior 5 years?

The records are run between @StartDate and @EndDate

@StartDate is:
formula = DateValue({?Year},{?MONTH},01)

@EndDate is:
Select case {?MONTH}
case 4, 6, 9, 11
formula = DateValue({?Year},{?MONTH},30)
case 2
if {?Year} mod 4 = 0 _
then _
formula = DateValue({?Year},{?MONTH},29) _
else _
formula = DateValue({?Year},{?MONTH},28) _
case else
formula = DateValue({?Year},{?MONTH},31)
End select


I'd like to be able to show an alert (a warning to please run the report again) to the audience prior to the full query running if the dates do not fall within the restricted ranges.

Thanks for your help!

 
(
{@Enddate} < datadate and
year({@StartDate}) > year(datadate)-5
) and //etc.

Alerts in CR only pop up after the report runs, if I remember correctly, but you could set one up using:

(
{@Enddate} > datadate or
year({@StartDate}) <= year(datadate)-5
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top