Hi,
I have a query in which I use 'Count' to give me the number of rows returned for a particular data type. Now I would like to add grand total at the end, summing these counts.
For example, my query returns the following data:
Room Num Bed Size Bed Count
200 Twin 2
201 Double 1
202 Queen 1
203 Twin 10
The Bed Count column is from using 'Count' in my query, and grouping items together (for example, for Twin, there were actually 2 records and 10 records, respectively). I'd like to add 'Grand Total' now, which would be 14 in this case.
Any suggestions on how I can do this? I'd like to add it to the existing query, if possible, which I have coded within my VBA module. So far I have not been able to figure out how to add grand total to this.
In case it helps, the existing query is as follows (it is long because it joins several tables):
Thanks in advance for any help.
I have a query in which I use 'Count' to give me the number of rows returned for a particular data type. Now I would like to add grand total at the end, summing these counts.
For example, my query returns the following data:
Room Num Bed Size Bed Count
200 Twin 2
201 Double 1
202 Queen 1
203 Twin 10
The Bed Count column is from using 'Count' in my query, and grouping items together (for example, for Twin, there were actually 2 records and 10 records, respectively). I'd like to add 'Grand Total' now, which would be 14 in this case.
Any suggestions on how I can do this? I'd like to add it to the existing query, if possible, which I have coded within my VBA module. So far I have not been able to figure out how to add grand total to this.
In case it helps, the existing query is as follows (it is long because it joins several tables):
Code:
SELECT tblRoomItems.RoomID AS Room, tlkpSize.SizeID AS [Bed Size], Count(tblRoomItems.RoomID) AS [Bed Count], tblRoomItems.ConditionID AS Cond, tblSpaceUse.RoomName AS [Room Name], tblSpaceUse.RoomTypeID AS [Room Type], tblSpaceUse.RoomLocation AS Location, tblSpaceUse.HousingGuestracClassif AS [Guestrac Code]
FROM tblSpaceUse INNER JOIN (tlkpItemSubcategory INNER JOIN (tlkpSize INNER JOIN (tblItems INNER JOIN tblRoomItems ON tblItems.ItemID = tblRoomItems.ItemID) ON tlkpSize.SizeID = tblItems.ItemSizeID) ON tlkpItemSubcategory.ItemSubcatID = tblItems.ItemSubcategoryID) ON tblSpaceUse.RoomID = tblRoomItems.RoomID
WHERE (((tlkpItemSubcategory.ItemSubcatID)='bed'))
GROUP BY tblRoomItems.RoomID, tlkpSize.SizeID, tblRoomItems.ConditionID, tblSpaceUse.RoomName, tblSpaceUse.RoomTypeID, tblSpaceUse.RoomLocation, tblSpaceUse.HousingGuestracClassif
ORDER BY tlkpSize.SizeID, tblRoomItems.RoomID;
Thanks in advance for any help.