Hi,
I have a query that displays records off a major table. If there are 5 records for a given RoomID, the query will display 5 rows of information for the room. What I'd like to do now is just display 1 row, along with a column for the count. I have not worked much with counts and am unsure how to do this. Also, the query joins 4 tables to get this information, so it's a little more complicated.
My current SQL is:
The query results currently come out like this:
BedSize RoomID
T 115
T 115
T 115
T 115
T 115
T 123
T 123
T 123
T 123
T 123
Instead, I would like it to display:
BedSize RoomID Count
T 115 5
T 123 5
How would I add 'Count' to my Query?
Thank you in advance for any help.
I have a query that displays records off a major table. If there are 5 records for a given RoomID, the query will display 5 rows of information for the room. What I'd like to do now is just display 1 row, along with a column for the count. I have not worked much with counts and am unsure how to do this. Also, the query joins 4 tables to get this information, so it's a little more complicated.
My current SQL is:
Code:
SELECT tlkpSize.SizeID AS BedSize, tblRoomItems.RoomID
FROM 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
WHERE (((tlkpItemSubcategory.ItemSubcatID)="bed"));
BedSize RoomID
T 115
T 115
T 115
T 115
T 115
T 123
T 123
T 123
T 123
T 123
Instead, I would like it to display:
BedSize RoomID Count
T 115 5
T 123 5
How would I add 'Count' to my Query?
Thank you in advance for any help.