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!

Last 6 Months Sales Report MTD, LFM, ext.

Status
Not open for further replies.

wonderif1

MIS
Nov 16, 2004
6
US
I'm working on a sales report that gives monthly totals for the last 6 months. The issue is it works fine for the current month using MTD and LastFullMonth. I need a formula for the previous months and corresponding headers. if {SA_1_NF.Invoice_Date} in LastFullMonth then {SA_1_NF.Sales}. I'm using CR 9. Thanks in advance
CLewis
 
You will need to creat a formula for each month.

@-2mths

dateadd("m", -2, {currentdate})

Currentdate is a crystal function, you can replcae this with a date parameter if that is driving your report.

then in your display formula

if month({SA_1_NF.Invoice_Date}) = month({@-2mths} and
year({SA_1_NF.Invoice_Date}) = year({@-2mths} then {SA_1_NF.Sales} else 0

Or to eliminate the formula in a formula

if month({SA_1_NF.Invoice_Date}) = month(dateadd("m", -2, {currentdate})) and
year({SA_1_NF.Invoice_Date}) = year(dateadd("m", -2, {currentdate})) then {SA_1_NF.Sales} else 0

Ian Waterman
UK Crystal Reports Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top