View Full Version: Running Total based on Formula in Group Footer

kgroff >>Create/Modify >>Running Total based on Formula in Group Footer


<< Prev | Next >>

Crewdawg- 02-24-2006
Running Total based on Formula in Group Footer
I am using CR10 on a SQL2000 Server via OBDC. I am creating a summary for a payroll report which summarizes total hours as well as how many of those hours were regular or overtime. The report is grouped by Employee Code (as in Intials, also user name in DB). I have a running total which adds all of the hours that are applicable to that user code. I then use a fomrula to determine if the #RT is over 40 hours and if it is report 40 hours in Regular Hours column. Then anything over 40 is displayed in Overtime column. I need to create a Running Total (or sum of) how many hours were regular and how many overtime for the Reoort Footer. Here are my formulas. For some reason the totals do not add up. //1Accum whileprintingrecords; numbervar reg1 := reg1 + {@1RegHours}; numbervar ot1 := ot1 + {@1OverHours}; numbervar reg2 := reg2 + {@2RegHours}; numbervar ot2 := ot2 + {@2OverHours}; numbervar totreg := totreg + {@ToTReg}; numbervar totot := totot + {@TotOT}; //1TotOT (All output formulas are the same except for appropriate variable names) whileprintingrecords; numbervar ot1; Week 1 Week 2 Totals FirstN LastN Hours Regular Overtime Hours Regular Overtime Total Reg Total OT Joe Blow 42.15 40.00 2.15 42.15 40.00 2.15 80.00 4.30 Joe Schmoe 39.45 39.45 0.00 39.45 39.45 0.00 79.30 0.00 ------------------------------------------------------------------------------------------------------------------ 82.00 79.45 2.15 82.00 79.45 2.15 159.30 4.30 The total containing the numbers (79.45, 2.15, 159.30, and 4.30) are all the ones passed through the variables and do not add up correctly. Using this example: (159.30 + 4.30 = 164.00)=(82.00 + 82.00 = 164.00) In my report: (8513.51 + 2533.24 = 11047.15) <> (5526.56 + 5864.54 = 11400.50) For a difference of 353 Hours. +/- 3% Is to far off for a payroll report. Any ideas as to why only these totals done through variables are incorrect? I apologize for the mess.. this forum does not accept spaces well.

sybot_uk- 11-22-2007

Hi there, i'm not quite sure what you mean by the sums at the bottom. Where did the 82+82 come from? One thing you could check for it your group selection. Do you have a formula in the group selection expert? If you do this could be the cause as (i think) any exlcuded groups may still be included in the sums. The same is true if you are using a suppression formula one of the groups. Just a thought, maybe it will help.

JamesJ- 11-28-2007

Umm, if you'll notice, that message was posted over a year and a half ago. I doubt that he's still looking for help at this point. :-) James

djayatosu- 11-29-2007

lol :-)

Crewdawg- 12-03-2007

I am no longer watching this thread. To satisfy your curiosity the 82 came from the week 1 toatl plus week 2 total.

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.