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

Comparing data from different months in different years

Status
Not open for further replies.

Jake1

MIS
Aug 6, 2001
13
0
0
US
I need to compare activity totals from a month of last year to the same month of this year (ie November 2000 compared to November 2001). I have not been able to find an example of how to do this. I can do each month separately and then export them to an Excel spreadsheet but I would think I could create this report completely in Crystal. We are using Crystal Reports 7.0.
 
If you create two conditional totals, one for each period, you can use both totals in a formula. faq149-243 describes the technique for creating conditional totals. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Hi,

These formulas will work;

@Thisyear
If {Date} in date(2001,11,01) to date(2001,11,30) then {Amount} else 0

@Lastyear
If {Date} in date(2000,11,01) to date(2000,11,30) then {Amount} else 0

Hope this helps...

Nuffsaid.
 
Hello,

Taking Nuffsaid's idea and combining it with a date range parameter fielda dn the DateAdd() function may make this easier and more flexible:

@ThisYear
If {Date} in {?DateRangeParameter} then {Amount} else 0

@LastYear
If {Date} in
Dateadd("yyyy",-1,Minimum({?DateRangeParamater}) to
Dateadd("yyyy",-1,Maximum({?DateRangeParamater}) then {amount} else 0
Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top