469,128 Members | 1,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,128 developers. It's quick & easy.

SUM function two different fields in one table

I am trying to add the values of two fields in one table. Not sure how to get the SUM function to make this work.
Mar 27 '07 #1
6 4556
ronverdonk
4,258 Expert 4TB
For each row:
Expand|Select|Wrap|Line Numbers
  1. SELECT fielda+fieldb AS Total FROM table;
for total table:

Expand|Select|Wrap|Line Numbers
  1. SELECT SUM(fielda)+SUM(fieldb) AS Total FROM table,
Ronald :cool:
Mar 27 '07 #2
How do I work this into other criteria that will sort on other unique fields?
Mar 27 '07 #3
N/M that last post...I got it.
Mar 27 '07 #4
ronverdonk
4,258 Expert 4TB
Glad to be of help. See you next time.

Ronald :cool:
Mar 27 '07 #5
Hi guys,

i have the same problem but the fields are in a diffenret table, could u help me please????
Apr 20 '07 #6
sorry, i forgot tell that i have to check the name as well before sum the values...

thanks


Danylo
Apr 20 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Dalan | last post: by
18 posts views Thread by jimfortune | last post: by
11 posts views Thread by Geagleeye | last post: by
14 posts views Thread by Phil Stanton | last post: by
luckysanj
20 posts views Thread by luckysanj | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.