[AccessD] Report Summing Help

Gustav Brock Gustav at cactus.dk
Tue Jan 10 08:40:49 CST 2006


Hi Larry

OK. You could also have checked for the month:

  =PrevYrData * Sgn(Abs(intMontYePrev <= Month(Date())))

/gustav

>>> lmrazek at lcm-res.com 10-01-2006 15:21:55 >>>
Hi Gustav:

Good idea; this almost works for my situation, but I can't use it because
CurrYr occassionally has 0's in the past month. Ended up writing a query
that did the calculation and binding it to a subreport ... Not pretty, but
it works. 

Larry Mrazek
LCM Research, Inc.
www.lcm-res.com 
lmrazek at lcm-res.com 
ph. 314-432-5886
fx. 314-432-3304

-----Original Message-----
From: accessd-bounces at databaseadvisors.com 
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Tuesday, January 10, 2006 4:35 AM
To: accessd at databaseadvisors.com 
Subject: Re: [AccessD] Report Summing Help

Hi Larry

If you never (!) have data for a past month of zero (CurrYrData will
_always_ be 1 or more) you can do it very easily.
Right now you probably have a running sum for PrevYrData and CurrYrData.
That's the Totals.
Now, for Totals YTD sum on this expression:

  =PrevYrData * Sgn(CurrYrData)

Sgn() returns 0 for values of zero and 1 for positive values.

/gustav

>>> lmrazek at lcm-res.com 09-01-2006 22:16 >>>
Hi:

I have a report comparing previous year data with current year data. Let's
assume that the report was run for period 4, which included everything
Jan-March data:

Month:	PrevYrData	CurrYrData
Jan		10		10
Feb		20		10
Mar		10		10
Apr		10		0
May		10		0
Jun		10		0
Jul		10		0
Aug		10		0
Sept		10		0
Oct		10		0
Nov		10		0
Dec		10		0

Totals YTD	40		30 (I need it to do this)
Totals	130		30	 

I'd like the report to be able to calculate the YTD comparison totals, that
is, if we ran the report for the first 4 months, it would automatically
create YTD totals for the previous year for the first 4 months (instead of
calculating for all 12 months). 

Any ideas on how to approach this? This is generated from data off a
mainframe, so I don't have a lot of control over the format and fields. 





More information about the AccessD mailing list