sql - Counting Occurrences in MS Access -
i trying return list of rooms occupant or investigator associated with. want include people associated more 1 room.
i tried following query
select [occupant], [investigator], [room number], [room subuse], count([occupant]), count([investigator]) [facilities management schedule] group [occupant], [investigator], [room number], [room subuse] having (count([occupant]) > 1 or count([investigator]) > 1);
which seems not include weibo cai or occupancy in rooms 7148-*. because count of him existing in space not greater 1, there way reformat query obtain data want?
thanks, otterman
group by
, having
right idea, need group room information. use having
filter want:
select [room number], count([occupant]), count([investigator]) [facilities management schedule] group [room number] having (count([occupant]) > 1 or count([investigator]) > 1);
i don't know if [room subuse]
of interest. assumes occupant
, investigator
have null
values (as opposed blanks of sort) when fields not used.
Comments
Post a Comment