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!

Month to Date/Year to Date in same report 1

Status
Not open for further replies.

rmarcus

IS-IT--Management
Feb 18, 2001
15
ZA
I am using CR7 and have a table which details sales info by Doc ref. Each record shows Stock No, units sold, sales value and cost value.
Is there a way I can sumarize to show in one line the Stock No, Units Sold, Sales Value and Cost Value for Month to Date and Year to Date without having to create a sub report.

Thanks

Ralph
 
rmarcus: You will need to create running totals which in v7 I think you are restricted to using the RT() and ResetTotal() functions but I'm a bit rusty on those.

First create a Group by StockNo

Next create for each item you want to show(e.g. UnitsSold), formulas as follows:

MTDUnits
If SalesTranDate in PrintDate-(Day(PrintDate)-1) to PrintDate then UnitsSold

YTDUnits
If SalesTranDate in Date(Year(Printdate),1,1) to PrintDate then UnitsSold

etc.

Then use each formula as the basis for a running total placed on the GroupFooter for Stockno. and resetting to zero with a ResetTotal() formula placed in the GroupHeader for StockNo

That way your Group Footer line will read:
StockNo. RTMTDUnits RTMTDSales RTMTDCosts RTYTDUnits RTYTDSales RTYTDCosts or whatever sequence you want to put them in.

Hope this helps David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Another approach is to create two formula fields:

If {date} in yearToDate then {Units} else 0

and

If {date} in monthToDate then {Units} else 0

Group by product, and do subtotals of these formulas by product. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top