Storing cumulative data

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.
mogurekAsked:
Who is Participating?
 
Kevin CrossConnect With a Mentor Chief Technology OfficerCommented:
To get sum, you can just do this:
SELECT SUM([Accrual 1]) AS TotalAccural
FROM yourTableName

Open in new window

0
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
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
 
jamesguConnect With a Mentor Commented:

select Accural_1, (select sum(Accural_1) from table_name) as bucket
from table_name
0
 
jamesguCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.