I need help on how to approach this.
I have a table that contains trip
information.
---table trip_information-----
trip_start_date
trip_end_date
dest_start_date
dest_end_date
I have a 2nd table that contains
holidays.
---table holidays_information-----
holiday_date
I have a 3rd table that contains
exception days.
---table exception_days-----
code......exception
sa........every Saturday
su........every Sunday
ss........Saturday and Sunday
What I'm trying to do is determine total drive time
minus the exception days and holidays.
For Example:
If a car drove:
trip_start_date = 1/1/00 00:00
trip_end_date = 1/4/00 00:00
dest_start_date = 1/5/00 12:00
dest_end_date = 1/5/00 16:00
I would have trip = 3 days and dest = 4 hrs.
But I want to subtract the exception days and holidays.
So for example, if my exception was Sunday and
1/3/00 fell on a Sunday, I would subtract the time
that I drove on Sunday from the 3 days and 4 hrs.
Also, I would subtract the holidays if it were in that time period.