DSUM

  • Thread starter auujxa2 via AccessMonster.com
  • Start date
A

auujxa2 via AccessMonster.com

I am having one heck of a time, trying to create a running total in a query.

The field I want to keep a running total on is: [GM $ Growth Penetration] -
which is a percentage field
The query that field is in is: [Top80PrcntGM$Growth_subqry]

I'm sorting the field descending. My end goal is to show ONLY the records
where the running sum reaches 80%. (i.e. if there are ten records with a 10%
penetration, only show the first 8 records, because the running total is 80%)

I tried this, but it didn't work:

Running Total: DSUM([GM $ Growth Penetration],[Top80PrcntGM$Growth_subqry],)

Thank you in advance
 
R

Roger Carlson

Unfortunately, I don't really understand what you're trying to do. However,
on my website (www.rogersaccesslibrary.com), is a small Access database
sample called "RunningSumInQuery.mdb" which illustrates how to do a running
sum over the whole recordset or over groups.

Perhaps viewing the sample with the included documentation will help you in
the right direction. You can find the sample here:
http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=279

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
A

auujxa2 via AccessMonster.com

Since this is ending up in a report anyway, I decided to do the running sum
there. But if someone has time, please explain my example below in query
form. Thanks again.
I am having one heck of a time, trying to create a running total in a query.

The field I want to keep a running total on is: [GM $ Growth Penetration] -
which is a percentage field
The query that field is in is: [Top80PrcntGM$Growth_subqry]

I'm sorting the field descending. My end goal is to show ONLY the records
where the running sum reaches 80%. (i.e. if there are ten records with a 10%
penetration, only show the first 8 records, because the running total is 80%)

I tried this, but it didn't work:

Running Total: DSUM([GM $ Growth Penetration],[Top80PrcntGM$Growth_subqry],)

Thank you in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top