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

Aggregate two fields

P: n/a
Hi,
I have the Following Table [SALES]:

Month Quantity1 Quantity2
Jan 100 150
Feb 500 100
Mar 100 0

I need a query that can Aggregate Quantity1 and Quantity2, so I can
get:

Month [Quantity1+Quantity2]
Jan 250
Feb 600
Mar 100

SELECT Month, [Quantity1+Quantity2] as TOTAL FROM SALES
.... is this Query is OK? I get A blank result

Regards
LC

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


P: n/a
how about
SELECT Month, Quantity1 + Quantity2 As TOTAL
FROM Sales;

Nov 13 '05 #2

P: n/a
jr
This is how it works if using Access 97 2000 2002 xp

SELECT Month, [Quantity1]+[Quantity2] as TOTAL FROM SALES
.... is this Query is OK? I get A blank result

SELECT Month, [Quantity1+Quantity2] as TOTAL FROM SALES
.... is this Query is OK? I get A blank result

<ca******@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hi,
I have the Following Table [SALES]:

Month Quantity1 Quantity2
Jan 100 150
Feb 500 100
Mar 100 0

I need a query that can Aggregate Quantity1 and Quantity2, so I can
get:

Month [Quantity1+Quantity2]
Jan 250
Feb 600
Mar 100

SELECT Month, [Quantity1+Quantity2] as TOTAL FROM SALES
... is this Query is OK? I get A blank result

Regards
LC

Nov 13 '05 #3

P: n/a
This works for a table I have.
SELECT Payments.PY_PayDate, [PY_CourseAmtPaid]+[PY_TextAmtPaid] _
AS Total FROM Payments;

The only thing I can see is month is a reserved word and and the
; at the end you may need to say:

SELECT Sales.Month, [Quantity1+Quantity2] as TOTAL FROM SALES;

HTH
Ron
jr wrote:
This is how it works if using Access 97 2000 2002 xp

SELECT Month, [Quantity1]+[Quantity2] as TOTAL FROM SALES
... is this Query is OK? I get A blank result

SELECT Month, [Quantity1+Quantity2] as TOTAL FROM SALES
... is this Query is OK? I get A blank result

<ca******@yahoo.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hi,
I have the Following Table [SALES]:

Month Quantity1 Quantity2
Jan 100 150
Feb 500 100
Mar 100 0

I need a query that can Aggregate Quantity1 and Quantity2, so I can
get:

Month [Quantity1+Quantity2]
Jan 250
Feb 600
Mar 100

SELECT Month, [Quantity1+Quantity2] as TOTAL FROM SALES
... is this Query is OK? I get A blank result

Regards
LC



Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.