Avatar of cres1121
cres1121
 asked on

Running Total

I have a table called tblpaysummary and a tblpayrollpaying.  I have query that shows me all the records from tblpaysummary where paydate = tblpayrollpaying.  In addition, in the query, I would like to create a running total of all the grossprofits plus the grossprofit by salemen. I have attached a database with my tables and query.
question.accdb
Microsoft Access

Avatar of undefined
Last Comment
cres1121

8/22/2022 - Mon
Gozreh

Check this out
question.accdb
cres1121

ASKER
I need it to add up for the cumulative total everything in the tblpaysummary table versus just what is returned in the query.  So the cumulative total is from the beginning of the year.  As a side when you use dsum does all your criteria have to come from the tblpaysummary or can you reference other fields in your query.
Gozreh

Your help has saved me hundreds of hours of internet surfing.
fblack61
cres1121

ASKER
Thanks I have read that many times.  To bad it makes very little sense to me.  I will keep trying
Jeffrey Coachman

Then does it *have* to be done in a query?
This is ridiculously easy to do in a Report (using the running sum property of a control...)
imagequestion.accdb
cres1121

ASKER
I so appreciate it needs to be done in query because I have to determine a commission percentage based on the total grossprofit.  We have three different levels and I want to have the query pick the rate.  >300000 is 12% >600000 is 15% and over 600000 is 18%.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Jeffrey Coachman

I have to determine a commission percentage based on the total grossprofit.  We have three different levels and I want to have the query pick the rate.  >300000 is 12% >600000 is 15% and over 600000 is 18%.
?
This was not what you stated in your original post.

You asked for this:
I would like to create a running total of all the grossprofits plus the grossprofit by salemen.
...this is what my report displays.
cres1121

ASKER
Well I can do the logic if I get the running total in my query.  That is why I can't do it in a report.
ASKER CERTIFIED SOLUTION
Gozreh

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
cres1121

ASKER
This is exactly what I needed. I so appreciate the help now I have to make it work in my enviorment
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
cres1121

ASKER
I am not getting it.. I get a #error what does that mean other than it is wrong.  I had to do it from a query versus a table but so frustrating.
Gozreh

What is error you are getting ?
Gozreh

Show me the criteria you using in the dsum statement
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
cres1121

ASKER
I took it one variable at a time and finally got more then #error... Thanks again..  Not done but one step I might be back