?
Solved

Storing cumulative data

Posted on 2008-10-02
6
Medium Priority
?
239 Views
Last Modified: 2013-11-28
how do you create a "bucket" for numbers and store them in a seperate field in a query?  Example: I have detail records that have data stored in a field called Accural 1which has the following data in detail records:Record 1= .0245, Record 2 = .0358, Recordl 3 = .458.  The bucket or new field would show the total or  .5183 in this example.
0
Comment
Question by:mogurek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 672 total points
ID: 22630680
To get sum, you can just do this:
SELECT SUM([Accrual 1]) AS TotalAccural
FROM yourTableName

Open in new window

0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 664 total points
ID: 22630683
it is not advisable to store calculated values in a table.

yuo can always get the total value by using sum or dsum functions

in a query assuming you have a recordId and Accural 1 fields

select recordID, sum([Accural 1]) as TotalAccural
group by recordID
0
 
LVL 9

Assisted Solution

by:jamesgu
jamesgu earned 664 total points
ID: 22630688

select Accural_1, (select sum(Accural_1) from table_name) as bucket
from table_name
0
 
LVL 9

Expert Comment

by:jamesgu
ID: 22630701
agree with capricorn1:

if one of the value is changed, the sum value will become incorrect,
or you may have to update the sum value as well.


0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question