G
Gina Whipp
Hey All,
Also, I need to convert my time caculation to decimal. The below code
actully worked until txtStartTime = 03:00 PM and txtEndTime = 01:00 AM; then
my Me.txtTimeDecimal = -15.00. If someone can explain why my txtTimeDecimal
isn't working when the time crosses the day it would really help.
If Not IsNull(Me.txtStartTime) And DLookup("apEmploymentStatus",
"tblAssociateProfile", "[apAssociateID]=" & "'" & Me![txtAssociateID] & "'")
= "Active" Then
Me.txtTimeDecimal = Abs((Me.txtStartTime - 1) * 24 - Me.txtEndTime *
24) - 24 - DLookup("sLunchBreak", "tblShift", "[sShiftID]=Form.txtShiftID")
* 24
Me.txtTimeSpent = (Me.txtStartTime - 1 - Me.txtEndTime) +
DLookup("sLunchBreak", "tblShift", "[sShiftID]=Form.txtShiftID")
Else
Me.txtTimeDecimal = Abs((Me.txtStartTime - 1) * 24 - Me.txtEndTime *
24) - 24
Me.txtTimeSpent = (Me.txtStartTime - 1 - Me.txtEndTime)
End If
I thought about using DateDiff but...
?DateDiff("h","03:30 PM ","01:00 AM") comes up with -14 it's driving me
carzy.
Thanks in advanceGina Whipp
Also, I need to convert my time caculation to decimal. The below code
actully worked until txtStartTime = 03:00 PM and txtEndTime = 01:00 AM; then
my Me.txtTimeDecimal = -15.00. If someone can explain why my txtTimeDecimal
isn't working when the time crosses the day it would really help.
If Not IsNull(Me.txtStartTime) And DLookup("apEmploymentStatus",
"tblAssociateProfile", "[apAssociateID]=" & "'" & Me![txtAssociateID] & "'")
= "Active" Then
Me.txtTimeDecimal = Abs((Me.txtStartTime - 1) * 24 - Me.txtEndTime *
24) - 24 - DLookup("sLunchBreak", "tblShift", "[sShiftID]=Form.txtShiftID")
* 24
Me.txtTimeSpent = (Me.txtStartTime - 1 - Me.txtEndTime) +
DLookup("sLunchBreak", "tblShift", "[sShiftID]=Form.txtShiftID")
Else
Me.txtTimeDecimal = Abs((Me.txtStartTime - 1) * 24 - Me.txtEndTime *
24) - 24
Me.txtTimeSpent = (Me.txtStartTime - 1 - Me.txtEndTime)
End If
I thought about using DateDiff but...
?DateDiff("h","03:30 PM ","01:00 AM") comes up with -14 it's driving me
carzy.
Thanks in advanceGina Whipp

