Sum in two Columns

S

squiddy82

Is it possible to sum a third column where the first two columns are linked
but in either column
eg
Col1 Col2 Col3
A B 13
B C 20
B A 10
C B 15

Can I get a query to get the result when summed
Col1 Col2 Col3
A B 23
B C 35
Sorry it's not explained very well
 
J

Jeff Boyce

What's being summed? Under what conditions?

More info, please...

Jeff Boyce
<Office/Access MVP>
 
T

Tom Ellison

Dear Squid:

I can't be sure what you mean, but it looks like:

SELECT T1.Col1, T1.Col2, T1.Col3 + T2.Col3
FROM YourTable T1
INNER JOIN YourTable T2
ON T2.Col2 = T1.Col1
ORDER BY T1.Col1

Be sure to substitute your actual table name and column names. Leave the
aliases T1 and T2 as they are for now. Later, change them consistently if
you wish.

Tom Ellison
 
S

squiddy82

Columns 1 and 2 are names and column 3 is a score they have got together
there will be a forth column that will be an average aswell but I can work
out the last bit
 
Top