I have a Access DB table that have the following data.
Room-Bed | Status |
---|---|
100-A | Available |
100-B | Occupied |
101-A | Available |
101-B | Available |
102-A | Occupied |
102-B | Occupied |
Having the room logic calculation as follows
Is there a way to design a query such that it will computed a room-level result as follows
Room | Status |
---|---|
100 | Occupied |
101 | Available |
102 | Occupied |
Try this:
Select
CStr(Val([Room-Bed])) As Room,
Max([Status]) As RoomStatus
From
Rooms
Group By
CStr(Val([Room-Bed]))
Result:
Room | RoomStatus |
---|---|
100 | Occupied |
101 | Available |
102 | Occupied |