Hello All:
I am trying to run a query that will allow me to view the total of several numeric fields in a query, and then create a column for each that calculates the % of each row of the total.
The numeric fields are [CountofDoortoFP],[CountofDoortoRoom],[CountofDoortoTriage],[CountofDoortoReg], which are all grouped by [Path].
So, if my results query looked like this:
Path CountofDoortoFP
A 5
B 4
C 2
D 2
I would want a field that provides 5/13 for Path A, 4/13 for Path B, 2/13 for Path C, etc....
Can anyone help? Here is the SQL statement...
SELECT [All Times].Path, Avg([All Times].DoortoFP) AS AvgOfDoortoFP, Count([All Times].DoortoFP) AS CountOfDoortoFP, Avg([All Times].DoortoRoom) AS AvgOfDoortoRoom, Count([All Times].DoortoRoom) AS CountOfDoortoRoom, Avg([All Times].DoortoTriage) AS AvgOfDoortoTriage, Count([All Times].DoortoTriage) AS CountOfDoortoTriage, Avg([All Times].DoortoReg) AS AvgOfDoortoReg, Count([All Times].DoortoReg) AS CountOfDoortoReg
FROM [All Times]
GROUP BY [All Times].Path;
I am trying to run a query that will allow me to view the total of several numeric fields in a query, and then create a column for each that calculates the % of each row of the total.
The numeric fields are [CountofDoortoFP],[CountofDoortoRoom],[CountofDoortoTriage],[CountofDoortoReg], which are all grouped by [Path].
So, if my results query looked like this:
Path CountofDoortoFP
A 5
B 4
C 2
D 2
I would want a field that provides 5/13 for Path A, 4/13 for Path B, 2/13 for Path C, etc....
Can anyone help? Here is the SQL statement...
SELECT [All Times].Path, Avg([All Times].DoortoFP) AS AvgOfDoortoFP, Count([All Times].DoortoFP) AS CountOfDoortoFP, Avg([All Times].DoortoRoom) AS AvgOfDoortoRoom, Count([All Times].DoortoRoom) AS CountOfDoortoRoom, Avg([All Times].DoortoTriage) AS AvgOfDoortoTriage, Count([All Times].DoortoTriage) AS CountOfDoortoTriage, Avg([All Times].DoortoReg) AS AvgOfDoortoReg, Count([All Times].DoortoReg) AS CountOfDoortoReg
FROM [All Times]
GROUP BY [All Times].Path;