By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,905 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

How to Add two Columns from SQL Select?

P: n/a
Im currently having difficulty trying to write an SQL query in Access
which will add two columns together to calculate a totals column. For
example...

I was hoping to get the below resultset from my query, e.g.
"select name, hours, overtime, hours+overtime as total"

Name Hours Overtime Total
--------------------------------------
Bloggs 8 2 10
Smith 8 0 8
Jones 6 3 9
...
...
...etc

But the query I am trying does not work, I was also trying the sum
aggregate function but I assuming this will only sum the contents of 1
column.

Any help with this would be much appreciated!

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 16 Jun 2005 06:04:16 -0700, da*********@gmail.com wrote:

Other than wrapping the Name field in square brackets (because it is a
reserved word), your SQL is correct, assuming you also have a From
clause.

-Tom.

Im currently having difficulty trying to write an SQL query in Access
which will add two columns together to calculate a totals column. For
example...

I was hoping to get the below resultset from my query, e.g.
"select name, hours, overtime, hours+overtime as total"

Name Hours Overtime Total
--------------------------------------
Bloggs 8 2 10
Smith 8 0 8
Jones 6 3 9
..
..
..etc

But the query I am trying does not work, I was also trying the sum
aggregate function but I assuming this will only sum the contents of 1
column.

Any help with this would be much appreciated!


Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.