Hopefully this explaniation will help.
I have a database that collects run times for jobs. Some of the jobs start before midnight and can end either before midnight or after midnight.
Each job has a Service Level Agreement attached to it and depending on the job the SLA can either be before midnight or after.
I have multiple fields on the page - Here are the major ones:
SLA Name
Start Time
End Time
SLA Time
Missed SLA Time
Since some of the jobs run in a different time zone I need to convert the times to central time so I do have fields with the name converted as well.
Start Time - Convetred, End Time - Converted and SLA Time - Converted.
What I need to do is to calculate the missed SLA time if a job exceeds the SLA time. As long as the job ends at the same time period as the SLA (Example - SLA Time is 02:00 and the job completes at 03:00) then my calculations work correctly using the datediff
command above.
Where I am having an issue is if the SLA time is before midnight and the job completes after midnight.
The way I have the form created it actually builds the day's jobs from another table. So today I could have job a, job b, job d, job e and tomorrow I could have job a, job c, job d, job z.
The job I am currently working on is called 'Daily' it has a SLA time of 22:00 and the other day it started at 02:01 and completed at 02:04.
so the following would be true:
SLA Name: Daily
Start Time: 02:01
End Time: 02:04
SLA Time: 22:00
Missed SLA Time: 04:04
What I am trying to do is to get the macro that I have set up to calculate the Missed SLA time.
The SLA Name and the SLA Time are auto populated from my tables and the Start Time and End Time are entered in manually by my department.
I hope this helps - if not I might be able to send you a blank copy of the database.
Thanks