C
carriey
I have a Crosstab query that gives a sum of the total number of locations
(this is the field Locations) by month for each category. I also need it to
give the total number of locations for the quarter but that part of my query
isn't working. I think it is doing a count instead but I have tried a bunch
of stuff and can't seem to get the quarters to total properly. Can someone
see what I'm doing wrong?
TRANSFORM Sum(Qry_Count_Obligations_Locations.Locations) AS TotalLocations
SELECT Qry_Count_Obligations_Locations.Obligation_Type,
Sum(Qry_Count_Obligations_Locations.Locations) AS SumOfLocations,
Abs(Sum(DatePart("q",[Oblig_Date])=1)) AS Q1,
Abs(Sum(DatePart("q",[Oblig_Date])=2)) AS Q2,
Abs(Sum(DatePart("q",[Oblig_Date])=3)) AS Q3,
Abs(Sum(DatePart("q",[Oblig_Date])=4)) AS Q4
FROM Qry_Count_Obligations_Locations
GROUP BY Qry_Count_Obligations_Locations.Obligation_Type
PIVOT Format([Qry_Count_Obligations_Locations].[Oblig_Date],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
Thank you so much!!!
(this is the field Locations) by month for each category. I also need it to
give the total number of locations for the quarter but that part of my query
isn't working. I think it is doing a count instead but I have tried a bunch
of stuff and can't seem to get the quarters to total properly. Can someone
see what I'm doing wrong?
TRANSFORM Sum(Qry_Count_Obligations_Locations.Locations) AS TotalLocations
SELECT Qry_Count_Obligations_Locations.Obligation_Type,
Sum(Qry_Count_Obligations_Locations.Locations) AS SumOfLocations,
Abs(Sum(DatePart("q",[Oblig_Date])=1)) AS Q1,
Abs(Sum(DatePart("q",[Oblig_Date])=2)) AS Q2,
Abs(Sum(DatePart("q",[Oblig_Date])=3)) AS Q3,
Abs(Sum(DatePart("q",[Oblig_Date])=4)) AS Q4
FROM Qry_Count_Obligations_Locations
GROUP BY Qry_Count_Obligations_Locations.Obligation_Type
PIVOT Format([Qry_Count_Obligations_Locations].[Oblig_Date],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
Thank you so much!!!