Hello,
I have a problem concerning one of my functions and I think that you could help me. I was helped on this site by TimK and Harry of the site access-programmers to carry out the beginning then I progress on my function by myself.
This function makes the difference between two dates by delete saturdays afternoons, Sundays and the bank holidays. I use also a timetable, I take into account only these schedules.
which are:
StartDate: 09:00:00
LunchStart: 12:00:00
LunchEnd: 13:30:00
HeureFin: 17:30:00
EndDate = 07:00:00
My StartDate is 07:00:00 and for my calculates StartDate = 09:00:00.
My problem is as follows:
If I take the example of one day:
StartDate: 14/06/2003 08:00:00
EndDate: 16/06/2003 08:00:00
I must find as a second = 10800
I find with my function = 36000
For me, I must only keep saturdays morning and to delete saturdays after midday, Sunday but him it keeps Monday. I think the problem is when i delete the saturday afternoon.
Could you look at my code to see or I must improve it Thank you for your assistance. Here the code which I use. In the field result, i use the second format. My Country Option is the european format jj/mm/aa hh:mm:ss and when i change, the result is not the same if i use the English format in country option.
I have a problem concerning one of my functions and I think that you could help me. I was helped on this site by TimK and Harry of the site access-programmers to carry out the beginning then I progress on my function by myself.
This function makes the difference between two dates by delete saturdays afternoons, Sundays and the bank holidays. I use also a timetable, I take into account only these schedules.
which are:
StartDate: 09:00:00
LunchStart: 12:00:00
LunchEnd: 13:30:00
HeureFin: 17:30:00
EndDate = 07:00:00
My StartDate is 07:00:00 and for my calculates StartDate = 09:00:00.
My problem is as follows:
If I take the example of one day:
StartDate: 14/06/2003 08:00:00
EndDate: 16/06/2003 08:00:00
I must find as a second = 10800
I find with my function = 36000
For me, I must only keep saturdays morning and to delete saturdays after midday, Sunday but him it keeps Monday. I think the problem is when i delete the saturday afternoon.
Could you look at my code to see or I must improve it Thank you for your assistance. Here the code which I use. In the field result, i use the second format. My Country Option is the european format jj/mm/aa hh:mm:ss and when i change, the result is not the same if i use the English format in country option.
Code:
'This function calcul the difference between two dates
'The day is composed like this
'DayStart = "09:00:00"
'LunchStart = "12:00:00"
'LunchEnd = "13:30:00"
'DayEnd = "17:30:00"
'I subtract the saturday afternoon (13:30:00 - 17:30:00) and the sunday
My function is too long and i can't post the function. You can see my function in VBA. The name on my function is TimeWorkedSeconds3
Thanks for your help
Nilses