C
Coplinator
I have 3 main tables:
1) Applications - CustomerID, ArrivalDate, DepartureDate
2) Rooms - CustomerID, TimeframeID
3) Timeframes - TimeframeID, StartDate, EndDate
Application relates to Rooms by CustomerID and Rooms relates to Timeframes
by TimeframeID. A Timeframe is for one week at a time, for instance
5/10-5/16.
A customer can have multiple records in the Rooms table, so I'm trying to
verify whether or not those on the Rooms table actually have a record on the
Applications table that matches the date constraints of that timeframe.
For instance, customer 001 applied for 5/10 to 5/16 and therefore has been
booked a room for 5/10 to 5/16. We received a call today and now he would
like to change his dates to 5/31 to 6/6.
It's simple enough to change his desired dates on the application, but what
if we forget to remove the booking for the old application dates?
I've been stumbling through writing this sql and am not having any luck at
all.
Note - A customer can have multiple weeks stay on their application (5/10 to
6/6).
Any help would be greatly appreciated.
1) Applications - CustomerID, ArrivalDate, DepartureDate
2) Rooms - CustomerID, TimeframeID
3) Timeframes - TimeframeID, StartDate, EndDate
Application relates to Rooms by CustomerID and Rooms relates to Timeframes
by TimeframeID. A Timeframe is for one week at a time, for instance
5/10-5/16.
A customer can have multiple records in the Rooms table, so I'm trying to
verify whether or not those on the Rooms table actually have a record on the
Applications table that matches the date constraints of that timeframe.
For instance, customer 001 applied for 5/10 to 5/16 and therefore has been
booked a room for 5/10 to 5/16. We received a call today and now he would
like to change his dates to 5/31 to 6/6.
It's simple enough to change his desired dates on the application, but what
if we forget to remove the booking for the old application dates?
I've been stumbling through writing this sql and am not having any luck at
all.
Note - A customer can have multiple weeks stay on their application (5/10 to
6/6).
Any help would be greatly appreciated.