Total Sum (1 Viewer)

DataAnalyst86

Registered User.
Local time
Today, 11:38
Joined
Nov 3, 2017
Messages
13
Hello All,

I have 4 individual queries calculating 3 values each. Sum #1, Sum#2, and Record Count.

I would like to create a 5th query that combines these 4 values (Total Sum#1, Total Sum#2, and Total Count) How do I go about doing that?

Playing around with the expression builder and can't figure out how to execute this.

Thanks a bunch, Affleck.
 

plog

Banishment Pending
Local time
Today, 10:38
Joined
May 11, 2011
Messages
11,638
Define "combines". Do you want this new query to have 3 records (one for each of the values) or just one record (where the 3 values are added together)?
 

DataAnalyst86

Registered User.
Local time
Today, 11:38
Joined
Nov 3, 2017
Messages
13
One record is fine. With each of the 3 totaled values
 

plog

Banishment Pending
Local time
Today, 10:38
Joined
May 11, 2011
Messages
11,638
Are these 3 queries all based on the same table(s)? Can you post the SQL of each?
 

DataAnalyst86

Registered User.
Local time
Today, 11:38
Joined
Nov 3, 2017
Messages
13
It's actually 4 queries with 3 calculated values each.

I now want to do a 5th query with 3 calculated values which are the sum of the previously 3 calculated values.

SELECT DISTINCTROW Sum([DCCI Change].PledgeAmount) AS [Pledge Total], Sum([DCCI Change].GiftAmount) AS GiftTotal, Count(*) AS [Record Count]
FROM [DCCI Change];

SELECT DISTINCTROW Sum([DCCI No Change].PledgeAmount) AS [Pledge Total], Sum([DCCI No Change].GiftAmount) AS GiftTotal, Count(*) AS [Record Count]
FROM [DCCI No Change];

SELECT DISTINCTROW Sum(tbl_No_Thank_You.PledgeAmount) AS [Pledge Total], Sum(tbl_No_Thank_You.GiftAmount) AS GiftTotal, Count(*) AS [Record Count]
FROM tbl_No_Thank_You;

SELECT DISTINCTROW Sum(DCCI_NO_ID.PledgeAmount) AS [Pledge Total], Sum(DCCI_NO_ID.GiftAmount) AS GiftTotal, Count(*) AS [Record Count]
FROM DCCI_NO_ID;
 

plog

Banishment Pending
Local time
Today, 10:38
Joined
May 11, 2011
Messages
11,638
I think you either have set up your tables incorrectly (if you have multiple tables with the exact same fields you have), or you have gone down the wrong path in pulling this data together.

Can you post a sample of your database?
 

Users who are viewing this thread

Top Bottom