PLS Help!! Sumif formula in MS Access

glmleilei

New member
Local time
Yesterday, 17:43
Joined
Apr 22, 2015
Messages
4
I've been searching the answer for the whole day, and wont be able to find my answer. Thanks for your help in advance! I'll get straght into it.

My Dataset:
ColunmA ColunmB Value
a b 1
b d 2
a q 3
c a 5
b e 2
d e 10
f q 1
q m 8
. . .
. . .
. . .

In Excel, I would do sumif( ColunmB,a2,Value), which gives me a result:

ColunmA ColunmB Value Result
a b 1 15
b d 2 2
a q 3 15
c a 5 8
b e 2 2
d a 10 2
f b 1 0
q c 8 0
. . . .
. . . .
. . . .

So based on each string in ColunmA, it would search all ColunmB and return an aggregated value.
How can i get the same result by Access/SQL query?

Regards,

Michael
 
something like

SELECT *, (SELECT Sum(Value) FROM myDataset AS T WHERE ColumnB=myDataset.ColumnA) AS Result
FROM myDataset
 
Worked lika a charm!!!
I shouldve posted 2 days ago. So i can get the answer within 5min instead of searching for 5hours lol. Much Appreciated!
 
Don't forget to post the answer to the site(s) you cross-posted to.
 

Users who are viewing this thread

Back
Top Bottom