P
papa jonah
I have three queries that are similar and I want to combine them if
possible.
The first provides a list of organizations and a total of the number of
"subgroups" assigned to each one.
SELECT [Division group cross table].Division, Count(Subgroup.Subgroup)
AS [Num Subgroups]
FROM ([Data] LEFT JOIN (Division LEFT JOIN [Division group cross table]
ON Division.Div = [Division group cross table].[Group/Org]) ON
[Data].[ORPS Designator] = Division.[Designator]) INNER JOIN Subgroup
ON [Data].[Designator] = Subgroup.[Designator]
GROUP BY [Division group cross table].Division;
The result looks like
Org Num
B 4
C 3
LB 7
MX 1
The other two are similar except one limits the subgroups to those that
equal "10A2", and the other limits them to those equal to "10A3".
These are subsets of the total number displayed in the first query
What I would like is an output resembling
Org Total 10A2 10A3
B 4 1 1
C 3 0 1
LB 7 4 1
MX 1 0 0
possible.
The first provides a list of organizations and a total of the number of
"subgroups" assigned to each one.
SELECT [Division group cross table].Division, Count(Subgroup.Subgroup)
AS [Num Subgroups]
FROM ([Data] LEFT JOIN (Division LEFT JOIN [Division group cross table]
ON Division.Div = [Division group cross table].[Group/Org]) ON
[Data].[ORPS Designator] = Division.[Designator]) INNER JOIN Subgroup
ON [Data].[Designator] = Subgroup.[Designator]
GROUP BY [Division group cross table].Division;
The result looks like
Org Num
B 4
C 3
LB 7
MX 1
The other two are similar except one limits the subgroups to those that
equal "10A2", and the other limits them to those equal to "10A3".
These are subsets of the total number displayed in the first query
What I would like is an output resembling
Org Total 10A2 10A3
B 4 1 1
C 3 0 1
LB 7 4 1
MX 1 0 0