"Blending" to tables

DanG

Registered User.
Local time
Today, 12:33
Joined
Nov 4, 2004
Messages
477
I just can't seem to wrap my head around this..
I have two tables as follows with "exactly" the same layout..
(the tables are the result of 2 different totals queries)
Active Flow (AF) (TableName)
District (there are 12 different districts or branches of offices)
Range ($0, $500, $10,000, $30,000...)
Client Count (by range)
Assets (Sum of assets by range)
Report (AF)

Flow Suspended (FS) (TableName)
District (there are 12 different districts or branches of offices)
Range ($0, $500, $10,000, $30,000...)
Client Count (by range)
Assets (Sum of assets by range)
Report (FS)

I have used a sub report to get the results needed, but the boss wants to "blend" the results to look as follows in a report..

District...range...client count (AF)...client count (FS)...client count total...assets(AF)...assets (FS)...Assets total.

The problem...I can almost get there but (AF) table has 80 records and (FS) table has 83 records and I can only get 80 records to show on report.
The 3 records that get dropped are from (FS) table. It seems that if all districts have counts in all ranges it is fine, but if one district does not have counts in all ranges the other tables non matching ranges get dropped.
I have tried combining to table into one table..no luck
I have tried inner and outer joins...no luck
I have tried beating my head on my desk...only hurts

I have attached a sample db for viewing...

Thank you
 
Sorry, it's my first time I loaded a .Mdb file 1st time.
 

Attachments

SELECT FS.District, FS.Range,
AF.[Client Count] AS [Client Count (AF)], FS.[Client Count] AS [Client Count (FS)],
Nz(AF.[Client Count]) + FS.[Client Count] AS [Client Count Total],
AF.Assets AS [Assets (AF)], FS.Assets AS [Assets (FS)],
Nz(AF.Assets) + FS.Assets AS [Assets Total]
FROM [Active Flow] AS AF RIGHT JOIN [Flow Suspendied] AS FS ON (AF.District = FS.District) AND (AF.Range = FS.Range);
.
 
Last edited:
Jon,
Thank you so much.
I never would have thought to do it that way.
It's so funny, I know the basic building blocks and understand how you did each component of it but it really is...how you put it all together.
I have really learned from this.

Thank you
 

Users who are viewing this thread

Back
Top Bottom