I am making a crosstable query out of the following query:
Query Name: Qr_VM_ZoneReport_ZoneTop15
SELECT Tb_VM_ZoneReports_Summ.Year,
Tb_VM_ZoneReports_Summ.Week,
Tb_VM_ZoneReports_Summ.Joint_Name,
Tb_VM_ZoneReports_Summ.Zone, Tb_VM_ZoneReports_Summ.Bldg,
Tb_VM_ZoneReports_Summ.Requests,
Tb_VM_ZoneReports_Summ.Request_Area, DD_II_Weeks.Start_DT,
DD_II_Weeks.End_DT, Tb_VM_ZoneReports_Summ.Res_Count AS
T_Res, Tb_ZoneReport_Week_Loc_Zone.Total AS T_Req_Area,
Tb_ZoneReport_Week_Loc_Zone.[Top 15 Total] AS T_Zone,
Tb_ZoneReport_Week_Loc_Zone.[Total Loc] AS T_Loc
FROM (Tb_VM_ZoneReports_Summ INNER JOIN DD_II_Weeks ON
(Tb_VM_ZoneReports_Summ.Year = DD_II_Weeks.Week_Year) AND
(Tb_VM_ZoneReports_Summ.Week = DD_II_Weeks.Week_No)) INNER
JOIN Tb_ZoneReport_Week_Loc_Zone ON
(Tb_VM_ZoneReports_Summ.Zone =
Tb_ZoneReport_Week_Loc_Zone.Zone) AND
(Tb_VM_ZoneReports_Summ.Year =
Tb_ZoneReport_Week_Loc_Zone.Year) AND
(Tb_VM_ZoneReports_Summ.Week =
Tb_ZoneReport_Week_Loc_Zone.Week) AND
(Tb_VM_ZoneReports_Summ.Joint_Name =
Tb_ZoneReport_Week_Loc_Zone.Joint_Name) AND
(Tb_VM_ZoneReports_Summ.Request_Area =
Tb_ZoneReport_Week_Loc_Zone.Request_Area)
WHERE (((Tb_VM_ZoneReports_Summ.Year)=[Enter the
correct year below (yyyy)]) AND
((Tb_VM_ZoneReports_Summ.Week)=[Your report is for which
week?]))
ORDER BY Tb_VM_ZoneReports_Summ.Year,
Tb_VM_ZoneReports_Summ.Week,
Tb_VM_ZoneReports_Summ.Joint_Name,
Tb_VM_ZoneReports_Summ.Zone, Tb_VM_ZoneReports_Summ.Bldg,
Tb_VM_ZoneReports_Summ.Requests DESC ,
Tb_VM_ZoneReports_Summ.Request_Area;
Following is the sql for the crosstab query:
TRANSFORM Count(Qr_VM_ZoneReport_ZoneTop15.Requests) AS
[The Value]
SELECT Qr_VM_ZoneReport_ZoneTop15.Request_Area, Count
(Qr_VM_ZoneReport_ZoneTop15.Requests) AS [Total Of
Requests]
FROM Qr_VM_ZoneReport_ZoneTop15
GROUP BY Qr_VM_ZoneReport_ZoneTop15.Request_Area
PIVOT Qr_VM_ZoneReport_ZoneTop15.Bldg;
When I try to run the query it gives me the following
error:
The Microsoft Jet database engine does not
recognise '[Enter the correct year below (yyyy)]' as a
field name or expression
Now, if I remove all the criterias then it works fine but
doesnt serve my needs.
This is what I am trying to do:
I am building a report in which the "Request_Area" should
come in the rows & "bldg" goes horizontally across in
columns & somehow I have to get it by "Zone". Please let
me know.
Thanks,
Kash
______________________________________________
-----Original Message-----
Post your SQL and describe what error messages are being displayed that
prevent you from adding criteria.
--
HTH,
Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
.