Question : Caluculate if met SLA for completetion of task- Problem

Have problem see solution to
http://www.experts-exchange.com/Microsoft/Development/MS_Access/Access_Coding-Macros/Q_25047717.html

Works great for most but noticed time incorrect on some files:
Start                           Finish                          WorkTime                    Finish-Start
1/5/10 8:57 AM      1/5/10 11:53 AM      5.836666667      2:56
1/5/10 9:03 AM      1/5/10 11:56 AM      5.755555555      2:52
1/5/10 9:14 AM      1/5/10 11:55 AM      5.347222222      2:40
1/5/10 9:28 AM      1/5/10 11:58 AM      5.001666667      2:30
1/5/10 9:33 AM      1/5/10 11:55 AM      4.737777778      2:22
1/5/10 9:47 AM      1/5/10 12:03 PM      4.535555555      2:16
1/5/10 10:02 AM      1/5/10 11:54 AM      3.76                          1:52
1/5/10 10:36 AM      1/5/10 11:57 AM      2.712777778      1:21
1/5/10 10:37 AM      1/5/10 11:53 AM      2.538888889      1:16
1/5/10 10:40 AM      1/5/10 11:57 AM      2.549444444      1:16
1/5/10 10:47 AM      1/5/10 11:58 AM      2.367222222      1:11
1/5/10 10:48 AM      1/5/10 12:04 PM      2.527222222      1:15
1/5/10 10:50 AM      1/5/10 11:58 AM      2.275555556      1:08
1/5/10 10:57 AM      1/5/10 11:56 AM      1.983888889      0:59
1/5/10 11:50 AM      1/5/10 12:03 PM      0.44                          0:13
1/5/10 12:18 PM      1/5/10 2:44 PM      2.974722222      2:26
1/5/10 12:20 PM      1/5/10 2:43 PM      2.873611111      2:22
1/5/10 12:42 PM      1/5/10 2:40 PM      2.073888889      1:57
1/5/10 12:45 PM      1/5/10 2:19 PM      1.651666667      1:34
1/5/10 12:45 PM      1/5/10 2:19 PM      1.642222222      1:33

Help Please!
Susan

Answer : Caluculate if met SLA for completetion of task- Problem

SusanSSS,

The problem is that you changed the code in a way that made the function incorrectly calculate things.  To wit,
go to the spot where the elements of the Days array are initialized.  You have it as:

    ' array indicates whether that weekday is a regular workday.  Initialize to False    Days(1) = False
    Days(2) = True
    Days(3) = True
    Days(4) = True
    Days(5) = True
    Days(6) = True
    Days(7) = True

If you go back to the code I posted in http://www.experts-exchange.com/Q_25047717.html#26294158, you will
see that all of those elements should be initialized to False:

    ' array indicates whether that weekday is a regular workday.  Initialize to False
    Days(1) = False
    Days(2) = False
    Days(3) = False
    Days(4) = False
    Days(5) = False
    Days(6) = False
    Days(7) = False

Change those all to False in the code, and the query will return the right results.

Patrick
Random Solutions  
 
programming4us programming4us