Sam Summers
Registered User.
- Local time
- Today, 10:50
- Joined
- Sep 17, 2001
- Messages
- 939
Hello,
Can anyone help me?
I am trying to sum up the contents of certain fields in my crosstab query to display the totals in a sub-report created from the crosstab query.
You can see in the attached screenshot of my subform, the package numbers from 1 to R25 (as specified as column headings in the SQL below) with some having values.
I am trying to create the sum of Packages with items (Total Qty) as well as the Total Weight of all the items and the total cost (both of these are not working correctly either?)
TRANSFORM Count(ItemsInKits.EquipmentID) AS CountOfEquipmentID
SELECT ItemsInKits.EquipDescription, Equipment.LocationID, Location.JobNo, EquipLookup.UnitKg, EquipLookup.UnitValue, EquipLookup.HatchCode, EquipLookup.CommodityCode
FROM ((ItemsInKits INNER JOIN Location ON ItemsInKits.LocationID = Location.LocationID) INNER JOIN Equipment ON (Location.LocationID = Equipment.LocationID) AND (ItemsInKits.EquipmentID = Equipment.EquipmentID)) INNER JOIN EquipLookup ON (EquipLookup.EquipRef = Equipment.EquipRef) AND (ItemsInKits.EquipRef = EquipLookup.EquipRef)
WHERE (((Equipment.LocationID)=[Forms]![ManifestDetails]![LocationID].[Text]))
GROUP BY ItemsInKits.EquipDescription, Equipment.LocationID, Location.JobNo, EquipLookup.UnitKg, EquipLookup.UnitValue, EquipLookup.HatchCode, EquipLookup.CommodityCode
PIVOT ItemsInKits.KitNumber In (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,"R1","R2","R3","R4","R5","R6","R7","R8","R9","R10","R11","R12","R13","R14","R15","R16","R17","R18","R19","R20","R21","R22","R23","R24","R25");
I hope this makes sense?
Many thanks in advance
Can anyone help me?
I am trying to sum up the contents of certain fields in my crosstab query to display the totals in a sub-report created from the crosstab query.
You can see in the attached screenshot of my subform, the package numbers from 1 to R25 (as specified as column headings in the SQL below) with some having values.
I am trying to create the sum of Packages with items (Total Qty) as well as the Total Weight of all the items and the total cost (both of these are not working correctly either?)
TRANSFORM Count(ItemsInKits.EquipmentID) AS CountOfEquipmentID
SELECT ItemsInKits.EquipDescription, Equipment.LocationID, Location.JobNo, EquipLookup.UnitKg, EquipLookup.UnitValue, EquipLookup.HatchCode, EquipLookup.CommodityCode
FROM ((ItemsInKits INNER JOIN Location ON ItemsInKits.LocationID = Location.LocationID) INNER JOIN Equipment ON (Location.LocationID = Equipment.LocationID) AND (ItemsInKits.EquipmentID = Equipment.EquipmentID)) INNER JOIN EquipLookup ON (EquipLookup.EquipRef = Equipment.EquipRef) AND (ItemsInKits.EquipRef = EquipLookup.EquipRef)
WHERE (((Equipment.LocationID)=[Forms]![ManifestDetails]![LocationID].[Text]))
GROUP BY ItemsInKits.EquipDescription, Equipment.LocationID, Location.JobNo, EquipLookup.UnitKg, EquipLookup.UnitValue, EquipLookup.HatchCode, EquipLookup.CommodityCode
PIVOT ItemsInKits.KitNumber In (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,"R1","R2","R3","R4","R5","R6","R7","R8","R9","R10","R11","R12","R13","R14","R15","R16","R17","R18","R19","R20","R21","R22","R23","R24","R25");
I hope this makes sense?
Many thanks in advance