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!

Value from report run on 1 day needs to be used next day....

Status
Not open for further replies.

SaraJB

MIS
May 20, 2002
8
GB
I've created a report with a subreports looking at debit/credit transactions in a date range parameter and before the minimum date.
The report is to be run on a daily basis and consists of

Opening balance = sum{debit}+{credit} <{@min}
Debit = sum{debit} in {@min} to {@max}
Credit = sum{credit}in {@min} to {@max}
Closing Balance = (opening balance+debit)-credit

The problem is I need the opening balance to be the closing balance for the previous day and don't know the best way to get to this.
I've used subreports and created variables to share the data with the main report to perform the calculations. How do I incorporate all the formulas and different subreport criteria to get the closing balance to be the opening balance for the next day.

Any ideas?

Thanks
Sara
 
Assuming that {@min} is a parameter of type date,
then use the following:

Opening balance = sum{debit}+{credit} <({@min}-1)
Debit = sum{debit} in {@min} to {@max}
Credit = sum{credit}in {@min} to {@max}
Closing Balance = (opening balance+debit)-credit


note the -1 on the first line. I think this will give you what you want. Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top