Hello,
I've problem with Access when trying to calculate some stuff.
Let's assume I've the following table
Now I would like to use a "group by" for the "name"-column and sum up the val1 and val2.
Moreover I would like to know how many rows were "minimized"
Result:
Ok now my problem:
I would like to sum up val1 and val2 and then divide with the "amount"
The result should look like:
What I tried (in the access "design view"
Error message: Subqueries cannot be used in the expression "([val1]+[val2])/[amount]"
Can anyone help me out please?
Thanks in advance
I've problem with Access when trying to calculate some stuff.
Let's assume I've the following table
Code:
[Name]....[val1]..[val2]
User1........10......2
User1........20......4
User2........30......2
User2........30......2
User2........30......2
Moreover I would like to know how many rows were "minimized"
Code:
SELECT name, Sum(val1), Sum(val2), Count(name) As amount
FROM tblUser
GROUP BY name
Result:
Code:
[Name]....[val1]..[val2]..[amount]
User1........30......6..........2
User2........90......6..........3
Ok now my problem:
I would like to sum up val1 and val2 and then divide with the "amount"
The result should look like:
Code:
[Name]....[val1]..[val2]..[amount]....[avg]
User1........30......6..........2.......18
User2........90......6..........3.......32
What I tried (in the access "design view"
Code:
Field: avg: ([val1]+[val2])/[amount]
Total: sum
Can anyone help me out please?
Thanks in advance