Silvio,
I thought that the start and end dates you were entering into the filter was the date range that the user wished to reserve. For >example the dates entered are 01.06.09 - 05.06.09 would mean that the customer wanted to reserve all the days between those >dates
yes
>Are you needing to actually find any single days between the start and end date that are available for a specified umbrella? What >about for any umbrella (I can see this being useful also)?
yes
How resolve it ?
Finding the data, and then presenting the data are two different issues.
Finding it can be done with DO WHILE loops. First find all umbrellas that are free for the entire date range, then find all the umbrellas that are free for less than the entire range. For example if the date range is 5 days, I would loop through all umbrellas looking for any that are free for the entire 5 days. Then loop through for 4 days, then 3, then 2, then 1. This is more complex than it seems, since any that are available for 5 days will also be available for 4,3,2 and 1 day so they should be eliminated from subseqent searches. Also, you can't just pick any 3 day and any 2 day availability since the periods have to fill the entire 5 day period and not overlap. There are lots of combinations possible.
Perhaps a solution would be to first list all the 5 day availabilities, then if the customer doesn't like those, then all the ones with the first 4 days and all those with the last 1 day. Then 1 and 4, then 3 and 2, 2 and 3--still lots of possible combinations. If they want a 10 day reservation, then the possibilities get much larger.
OK, then how to present this to the user. Would I be correct in assuming that customers may want to specify a certain umbrella, or one near the water, or maybe not near the water? How important of an issue is this?
Adding an umbrella specification really adds to the complexity since all the date range searches would then have to be limited to either 1 umbrella or a range of umbrellas (like first row, second row, etc.). Whew!
Then it seems you also have another criteria, chairs or beds? How many options of these are there?
This is a much more complex problem than it seems at first. How are they doing this now? Manually? If so, then any automated system would be better than manual, but it does help to try to describe an ideal system from the start before coding. You can build a simple automated system (still better than manual) then continue to add and refine it.
Murphy's Law, "Nothing is as simple as it seems."James