simple (to everybody else) query about a query

dee dee

New member
Local time
Today, 11:02
Joined
Feb 26, 2007
Messages
3
for a hotel database i have check in date and check out date

how do i get a list of current occupants, ie a search using todays date

sorry if this is simple, but i am not great at access. i hate vb code as well
 
test the [checkout date] is null and the [checkin Date] is not null
 
i have a long list of check in dates, some from the past, some the future.

same for check out


i need a search to give me a list of customers presently there
 
Try <=Date() as the criteria under CheckIn and >=Date() under CheckOut ,

this should just select the current occupants.
 
hey it works!! thanks

right, to ask a more advanced question.


supposing i had four hotels

  • red
  • blue
  • green
  • yellow


each with 20 beds. how could i add up the number of customers on a particular date and produce a report showing empty beds on a certain day
 
IF you always have a check-in and check-out date (even if the latter is just an estimate), you can look at selecting all records where the current date is BETWEEN the check-in date AND the check-out date. Look up operator BETWEEN ... AND ... to see more on how this works.
 
Hi,

Ok for your second question, group by hotel in your query and add a calculated field to calculate the available occupancy something like the following

AvailableOccupancy: 20-Sum([NoofGuests*])

* or whatever you call your field that stores the number of customers booked in for each booking.

HTH
 

Users who are viewing this thread

Back
Top Bottom