D
DubboPete
Hi all,
In my table there are many bookings entries for a vehicle, covering a
calendar month or longer. What I am trying to do is calculate the
number of weekdays any given vehicle is not booked within a specified
month. Here's some examples.
Vehicle ABC123 has the following bookings ([startdate] [enddate])
01-Sep-09 03-Sep-09
11-Sep-09 18-Sep-09
In the perfect world, I'd like to update the field [nonbooked] with
the value 15.
1st to the 3rd is 3 working days. 11th to 18th is 6 working days,
and two weekend days. 22 working days in September-09 minus the sum(3
+ 6) = 15.
I'd like to be able to run this on my table for every entry, but ONLY
for a specified month period. That's because there are going to be
bookings that started in August 09, or may end in October 09, but I'm
only interested in what happens for the specified period.
So, if the bookings were ([startdate] [enddate])
31-Aug-09 03-Sep-09
11-Sep-09 18-Sep-09
the result would be the same 15, as 31-Aug-09 is ignored, but the 3
days in September for that booking are not!
Anyone up for the challenge? And, can this run from a command button
on a form please??
TIA
Pete
In my table there are many bookings entries for a vehicle, covering a
calendar month or longer. What I am trying to do is calculate the
number of weekdays any given vehicle is not booked within a specified
month. Here's some examples.
Vehicle ABC123 has the following bookings ([startdate] [enddate])
01-Sep-09 03-Sep-09
11-Sep-09 18-Sep-09
In the perfect world, I'd like to update the field [nonbooked] with
the value 15.
1st to the 3rd is 3 working days. 11th to 18th is 6 working days,
and two weekend days. 22 working days in September-09 minus the sum(3
+ 6) = 15.
I'd like to be able to run this on my table for every entry, but ONLY
for a specified month period. That's because there are going to be
bookings that started in August 09, or may end in October 09, but I'm
only interested in what happens for the specified period.
So, if the bookings were ([startdate] [enddate])
31-Aug-09 03-Sep-09
11-Sep-09 18-Sep-09
the result would be the same 15, as 31-Aug-09 is ignored, but the 3
days in September for that booking are not!
Anyone up for the challenge? And, can this run from a command button
on a form please??
TIA
Pete