To do this in a query you will have to build a Dates table (DateTbl) containing all possible dates (I've used DayDate as the name of the date field on this table)
You can then do something like...
Select PtName, admitDate, dischargeDate, month(Datestbl.DayDate) as Mth
from patientstable, Datestbl
where DateTbl.DayDate between admitDate and dischargedate
from there you can convert to a totals query and group on patient and month, and count any field.