Sum in two Columns

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top