Join Issue
Hi everyone,
I've been challenging with an query for a while now. I was wondering if anyone would help me with the subject.
Assume that I have a table named "Reservations"
this table has two dates as fields: "FromDate" and "ToDate"
A sample record would be like this:
"John Doe" "2010/09/02" "2010/09/04"
this means that John Doe has reserved a room from Sept 2th until Sept 4th.
Now I want a list of dates in a given range with the count of reservations regarding that date.
In this instance, if you assume that John Doe is the only reservation, the result set would be like this:
.
.
.
2010/09/01 0
2010/09/02 1
2010/09/03 1
2010/09/04 1
2010/09/05 0
.
.
.
__________________
Be Sure,
-hossrad
|