1 Reply Latest reply on Jun 9, 2009 10:18 AM by philmodjunk

    Finding the right formula...



      Finding the right formula...



      I am working for a client doing a database for a residence that has different rooms.... What they need basically is to know how many beds are occupied or lefet in each room... For instance, there is room 23 which is quadruple, 22 a double, 21, a single.... There are 2 people uccupying No 23 so 1 bed left... they want to have a screen that lets them know this data..who is where and how many beds are free... I must admit I have some problems to find out the best way to do that ....new database with relationship ? Or could I do that with only one... Not really mathematical ...if anyone could helpd me on this I'll really be gratefull... many thanks 

        • 1. Re: Finding the right formula...

          This sounds like a case where you need the right table/relationship structure rather than a complex formula.


          I'd set up a Room table for recording information on each room and a Bed table for information (such as vacant or occupied) on each bed. In the bed table I'd include a RoomID field that identifies the room where it is located. Now the number of beds assigned to a given room can be counted with the count function or a summary field, the number of occupied beds in the room can also be counted and the difference will give you the number of available beds in that room.