i need to calculate time, the problem i have is that we are trying measure production over the day, however our days run from
22:00 through to 22:00 the following evening
i have tried to calculate it by taking the end time from away the start time, but when i tried to do this it gives the wrong figure
DayCode - 3111 (This is just the code we use to represent each day)
Line - C3 ( Machine identification)
Start Time - 22:00 ( Time the Machine started)
End Time - 18:00 (time the machine ends)
Duration - 04:00 (the figure that is display when calculated in access)
the duration figure should be 20:00 hours
i have managed to get it to work upto a point with the following code
runtime: IIf([starttime]=[endtime] And [starttime]=#22:00:00#,#23:59:59#,IIf([starttime]>[endtime],(#23:59:59#-[starttime])+[endtime],[endtime]-[starttime]))
if the the two times are the same for example 22:00 on the first evening through til 22:00 the following evening, i should get a result of 24 hours but instead i get zero, so i was wondering if there is a work around to this problem, i also need the time to be displayed in full hours whereas the above code only dislpays it to the correct hour minus 1 second.
The primary reason for using a general date is to differentiate between days. Meaning that you need to be looking for the difference between 10:00 yesterday and 10:00 today.
If you use the same date for both Start and end and they are both 10:00 your result should be 0.
daycode 4001 is January 1st
daycode 4002 is January 2nd etc
but daycode 4002 would start at 22:00 on daycode 4001 (does his makes any sense)
so i have a table that indicates
dates and daycodes
but on the data entry side i am required to just enter a daycode and the planned time for that day,
daycode - 4003 - (which is actually the tail end of Daycode 4002, in real terms)
Start - 22:00
End - 22:00 - (which is actually the tail end of Daycode 4003, in real terms)
Total planned production time is 24 hours.
can you see how this works, and also how stupid it is. the reason that they do it this way is all to do with shift patterns.
but i need to make it as simple as possible for the data inputters to use, thats why i want them to have to just enter the daycode and also start and end times.
i have seen this done on other programs so i know it can be done, but aint got a clue how to do it.
It sounds to like the easiest way to handel this would be validation code on the back side of the data entry form that converts the datecode and time entered by your user into a general date format to be storred in your table. I'm not sure from what you have told me if this is possible or not.