S
scott
I got the first query to work no problem..I am unsure of
how to set up the 2nd one...I used the table TBLNUMBERS
and the new query QSUMNUMBERS but I dont know how to link
them..then when I put in the code for the 2nd query I get
errors.
Thanks for any help
Scott
Subject: Re: adding up columns in queries?
From: "John Verhagen" <[email protected]> Sent:
9/11/2003 2:39:00 PM
Although a report would work better, here is what you
asked for:
Using tblNumbers as your table name, use 2 queries...
Call this one qSumNumbers
SELECT Sum(tblNumbers.Price) AS SumOfPrice, Sum(tblNumbers.
[State Tax]) AS
[SumOfState Tax], Sum(tblNumbers.[Local Tax]) AS
[SumOfLocal Tax],
Sum(tblNumbers.[Equipment Charge]) AS [SumOfEquipment
Charge]
FROM tblNumbers;
then use.
SELECT 1 as ID, Price, [State Tax], [Local Tax],
[Equipment Charge]
FROM tblNumbers
UNION ALL
Select 2 as ID, SumOfPrice, [SumOfState Tax],[SumOfLocal
Tax],[SumOfEquipment Charge]
FROM qSumNumbers
UNION ALL
Select 3 as ID, SumOfPrice + [SumOfState Tax]+[SumOfLocal
Tax]+[SumOfEquipment Charge], Null, Null, Null
FROM qSumNumbers;
how to set up the 2nd one...I used the table TBLNUMBERS
and the new query QSUMNUMBERS but I dont know how to link
them..then when I put in the code for the 2nd query I get
errors.
Thanks for any help
Scott
Subject: Re: adding up columns in queries?
From: "John Verhagen" <[email protected]> Sent:
9/11/2003 2:39:00 PM
Although a report would work better, here is what you
asked for:
Using tblNumbers as your table name, use 2 queries...
Call this one qSumNumbers
SELECT Sum(tblNumbers.Price) AS SumOfPrice, Sum(tblNumbers.
[State Tax]) AS
[SumOfState Tax], Sum(tblNumbers.[Local Tax]) AS
[SumOfLocal Tax],
Sum(tblNumbers.[Equipment Charge]) AS [SumOfEquipment
Charge]
FROM tblNumbers;
then use.
SELECT 1 as ID, Price, [State Tax], [Local Tax],
[Equipment Charge]
FROM tblNumbers
UNION ALL
Select 2 as ID, SumOfPrice, [SumOfState Tax],[SumOfLocal
Tax],[SumOfEquipment Charge]
FROM qSumNumbers
UNION ALL
Select 3 as ID, SumOfPrice + [SumOfState Tax]+[SumOfLocal
Tax]+[SumOfEquipment Charge], Null, Null, Null
FROM qSumNumbers;