Hello,
I'm using a DateDiff expression to calculate the difference in hours and minutes between two dates. For example,
Start date: 12/07/2017 13:20
End date: 12/07/2017 17:00
will return the correct value '4.4' (4 hours 40 mins). However, the following does not:
Start date: 12/07/2017 13:20
End date: 12/07/2017 14:00
This returns '1.4' when it should return '0.4' (40 mins). The code I've used is below:
Me.txtIntervalSampleToSampleR = DateDiff("h", Me.txtDateTimeOfSample, Me.txtDateTimeSampleReceived) & "." & (DateDiff("n", Me.txtDateTimeOfSample, Me.txtDateTimeSampleReceived) Mod 60)
What am I doing wrong?
I'm using a DateDiff expression to calculate the difference in hours and minutes between two dates. For example,
Start date: 12/07/2017 13:20
End date: 12/07/2017 17:00
will return the correct value '4.4' (4 hours 40 mins). However, the following does not:
Start date: 12/07/2017 13:20
End date: 12/07/2017 14:00
This returns '1.4' when it should return '0.4' (40 mins). The code I've used is below:
Me.txtIntervalSampleToSampleR = DateDiff("h", Me.txtDateTimeOfSample, Me.txtDateTimeSampleReceived) & "." & (DateDiff("n", Me.txtDateTimeOfSample, Me.txtDateTimeSampleReceived) Mod 60)
What am I doing wrong?