I hate crosstab queries. We have 50 that are dynamtic, they use another query to determine the column headings. All work fine except for 4, they are for a related subject so it might be one of the underlying queries that are causing me the problem. The crosstab will open with the correct headings but is empty. The underlying open and populate with the information.
Here is the crosstab:
TRANSFORM Sum(qrytblOdometersSample1.[Audited Miles]) AS [The Value]
SELECT qrytblOdometersSample1.Jurisdiction
FROM qryAudYrsExport LEFT OUTER JOIN qrytblOdometersSample1 ON qryAudYrsExport.AudYrs = qrytblOdometersSample1.[BegDate By Quarter]
GROUP BY qrytblOdometersSample1.Jurisdiction
PIVOT qryAudYrsExport.AudYrs;
Here are the 2 underlying queries.
SELECT DISTINCT Left([Period],4) AS AudYrs
FROM tblPeriod, tblRegistrantName
WHERE (((Left([Period],4) & "/" & Right([Period],1))>=Left([AudStart],4)));
and
SELECT DISTINCTROW Format$([tblOdometers].[BegDate]," yyyy") AS [BegDate By Quarter], tblOdometers.Jurisdiction, Sum(tblOdometers.[Reported Miles]) AS [Sum Of Reported Miles], Sum([EndOdom]-[BegOdom]) AS [Audited Miles]
FROM tblEquipment INNER JOIN tblOdometers ON tblEquipment.Unit = tblOdometers.Unit
GROUP BY Format$([tblOdometers].[BegDate]," yyyy"), tblOdometers.Jurisdiction, tblEquipment.FuelType, tblEquipment.[IFTA/MC]
HAVING (((Format$([tblOdometers].[BegDate]," yyyy"))<>1998) AND ((tblEquipment.FuelType)="DIE" Or (tblEquipment.FuelType)="XXX") AND ((tblEquipment.[IFTA/MC])="Y"))
ORDER BY tblOdometers.Jurisdiction;
Any ideas are GREATLY appreciated!! Thanks
Here is the crosstab:
TRANSFORM Sum(qrytblOdometersSample1.[Audited Miles]) AS [The Value]
SELECT qrytblOdometersSample1.Jurisdiction
FROM qryAudYrsExport LEFT OUTER JOIN qrytblOdometersSample1 ON qryAudYrsExport.AudYrs = qrytblOdometersSample1.[BegDate By Quarter]
GROUP BY qrytblOdometersSample1.Jurisdiction
PIVOT qryAudYrsExport.AudYrs;
Here are the 2 underlying queries.
SELECT DISTINCT Left([Period],4) AS AudYrs
FROM tblPeriod, tblRegistrantName
WHERE (((Left([Period],4) & "/" & Right([Period],1))>=Left([AudStart],4)));
and
SELECT DISTINCTROW Format$([tblOdometers].[BegDate]," yyyy") AS [BegDate By Quarter], tblOdometers.Jurisdiction, Sum(tblOdometers.[Reported Miles]) AS [Sum Of Reported Miles], Sum([EndOdom]-[BegOdom]) AS [Audited Miles]
FROM tblEquipment INNER JOIN tblOdometers ON tblEquipment.Unit = tblOdometers.Unit
GROUP BY Format$([tblOdometers].[BegDate]," yyyy"), tblOdometers.Jurisdiction, tblEquipment.FuelType, tblEquipment.[IFTA/MC]
HAVING (((Format$([tblOdometers].[BegDate]," yyyy"))<>1998) AND ((tblEquipment.FuelType)="DIE" Or (tblEquipment.FuelType)="XXX") AND ((tblEquipment.[IFTA/MC])="Y"))
ORDER BY tblOdometers.Jurisdiction;
Any ideas are GREATLY appreciated!! Thanks