Hello this is are 2 tables on my db :

I’m trying to get the hotels available for a interval of dates.
In the Rooms table are defined the types of rooms : eg Signe:max_guests=1, Triple : max_guests=3
So for 10 people booking i need something like:
SELECT SUM(rooms.max_guests * av.RoomAvailable) AS maxPeople
FROM av AS av INNER JOIN rooms
ON av.room = rooms.ID AND av.DateofDays BETWEEN '09/28/2012' AND '10/03/2012'
GROUP BY av.userid
HAVING Count(*) >= 6
but this doesn’t really fit my requirements ..it return me total max_people available/ userID i just need to check if every day for each userID(hotel) there’s >= 10 (max_people) available
Thank yo for your help
Update: if i use this query :
SELECT av.userid, av.DateofDays, SUM(rooms.max_guests *
av.RoomAvailable) AS maxPeople
FROM av AS av INNER JOIN rooms
ON av.room = rooms.ID AND av.DateofDays BETWEEN '09/28/2012'
AND '10/03/2012'
GROUP BY av.userid, av.DateofDays
ORDER BY av.userid, av.DateofDays
i get this:

You have to manually put in the number of days in the count.