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

All data and limited data on same report?

Status
Not open for further replies.

stormtrooper

Programmer
Apr 2, 2001
266
CA
Hi there. I have a report in which I need a summary of all data to date. But the report itself is limited by a selection criteria as follows:

if {?pStart_Dt} = "Default Value"
then {Report_Dt} >= {@Fiscal_Start_Dt} and {Report_Dt} <= {@Fiscal_End_Dt}
else
{Report_Dt} >= Date({?pStart_Dt}) and Report_Dt <= Date({?pEnd_Dt})

I've tried a subreport but that is still limited to the main report selection criteria.

Here's how the report should look like:


Feb/04
ABC Company
ACTIVE 176
INACTIVE 15
Increase in ACTIVE 161
XYZ Company
ACTIVE 65
INACTIVE 5
Increase in ACTIVE 60

TOTAL INCREASE IN ACTIVE FOR MONTH 221
TOTAL ACTIVE AT MONTH END 120221

Mar/04
ABC Company
ACTIVE 695
INACTIVE 12
Increase in ACTIVE 683
XYZ Company
ACTIVE 46
INACTIVE 2
Increase in ACTIVE 44

TOTAL INCREASE IN ACTIVE FOR MONTH 741
TOTAL ACTIVE AT MONTH END 120962


The "TOTAL ACTIVE FOR MONTH END" value is what I am after. It has to not be limited to the selection criteria and at the same time coincide with report month end.

Please advise, thanks.
 
A subreport isn't based on anything from the Main report unless you designate that it is.

This:

"if {?pStart_Dt} = "Default Value"
then {Report_Dt} >= {@Fiscal_Start_Dt} and {Report_Dt} <= {@Fiscal_End_Dt}
else
{Report_Dt} >= Date({?pStart_Dt}) and Report_Dt <= Date({?pEnd_Dt})"

only seems to limit rows based on the date, which you'd need for the subreport anyway to only return up to a certain date.

A formula such as:

dateadd("m",1,cdate(year({table.date}),month({table.date}),1))-1

Might work for joining (use in the subreport selection formula).

Place the subreport in the month group Footer and link by this formula.

Now edit the subreport record selection so that instead of an = set up by joining, you use <=.

Rather than supplying text descriptions, try supplying example data and the resultant output.

There are other potential methods as well, but without knowing the database and software versions, I'll setlle for this generic means.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top