If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Sum of field value based upon multiple instances of another value
I have a table with the following fields:
ITEM TOTAL REF The data is imported from Excel & the value in the ITEM field may be repeated for an instance in the REF field. So for 3 different REF values, the ITEM values may appear up to 3 times. Is it possible to produce a query which will show the total for each ITEM, rather than each instance? Thanks in advance. |
#2
|
|||
|
|||
Sum of field value based upon multiple instances of another value
On Sun, 15 Nov 2009 03:55:01 -0800, NAHolmes
wrote: I have a table with the following fields: ITEM TOTAL REF The data is imported from Excel & the value in the ITEM field may be repeated for an instance in the REF field. So for 3 different REF values, the ITEM values may appear up to 3 times. Is it possible to produce a query which will show the total for each ITEM, rather than each instance? Thanks in advance. Certainly. Create a Query based on the table; select the ITEM and TOTAL fields. CHange the query to a Totals query by clicking the Greek Sigma icon (summation sign, looks like a sideways M). Leave the default GROUP BY for Item and change it to SUM for Total. Since each row of the result will refer to three different REF values, you shouldn't display that field - there are tricks if you need to do so. -- John W. Vinson [MVP] |
#3
|
|||
|
|||
Sum of field value based upon multiple instances of another va
"John W. Vinson" wrote: On Sun, 15 Nov 2009 03:55:01 -0800, NAHolmes wrote: I have a table with the following fields: ITEM TOTAL REF The data is imported from Excel & the value in the ITEM field may be repeated for an instance in the REF field. So for 3 different REF values, the ITEM values may appear up to 3 times. Is it possible to produce a query which will show the total for each ITEM, rather than each instance? Thanks in advance. Certainly. Create a Query based on the table; select the ITEM and TOTAL fields. CHange the query to a Totals query by clicking the Greek Sigma icon (summation sign, looks like a sideways M). Leave the default GROUP BY for Item and change it to SUM for Total. Since each row of the result will refer to three different REF values, you shouldn't display that field - there are tricks if you need to do so. -- John W. Vinson [MVP] . Many thanks John. I guessed it would be something simple. I do indeed need to filter by the ref field, but I already have a series of other queries & a form to do that. I have just modified to relevant query for TOTALS & it works a treat. Thanks again. |
Thread Tools | |
Display Modes | |
|
|