Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I amtrying to get the value of the difference between two times with the code below.
Me.uf9a_tb_cend.Value = "3:00 pm"
Me.uf9a_tb_cstart.Value = "7:00 am"
The expected answer is 7.5 (difference between end and start times minus 30 minutes)
I am getting an anser of -4.0
Code:
tdiff = ((CDate(Me.uf9a_tb_cend.Value)) - (CDate(Me.uf9a_tb_cstart.Value))) - 0.5
.Cells(drow, 5) = Format(tdiff * 24, "0.0")
Me.uf9a_tb_cend.Value = "3:00 pm"
Me.uf9a_tb_cstart.Value = "7:00 am"
The expected answer is 7.5 (difference between end and start times minus 30 minutes)
I am getting an anser of -4.0