tranchemontaigne
Technical User
PROBLEM: I have a text box with a start time and a test box with a finish time value. I want to calculate the number of minitues that elapsed between these two values and display it in a 3rd text box.
FAILED APPROACH: My first thought was to make a click event that took the date/time value from one box and subtracted the date/time value from the second text box. This produced a fractional number that needed to be converted back into a date/time value using the cdate() function.
CONSIDERATION: This works, but is somewhat problematic if there is less than one hour between start and finish time. (date/time settings do not allow for a zero hour so the hour defaults to 12 (as it would do with midnight). (i.e. [3:00 PM] - [2:45 PM] = [12:15 AM])
GOAL: Ideally I would like this math operation ([3:00 PM] - [2:45 PM]) to produce the result of either [0:15] or [.25 hours]. I have no preference between either of these outputs.
Any thoughts on how to do this would be appreciated. I would gladly scrap the event driven approach if someone has a better idea.
FAILED APPROACH: My first thought was to make a click event that took the date/time value from one box and subtracted the date/time value from the second text box. This produced a fractional number that needed to be converted back into a date/time value using the cdate() function.
CONSIDERATION: This works, but is somewhat problematic if there is less than one hour between start and finish time. (date/time settings do not allow for a zero hour so the hour defaults to 12 (as it would do with midnight). (i.e. [3:00 PM] - [2:45 PM] = [12:15 AM])
GOAL: Ideally I would like this math operation ([3:00 PM] - [2:45 PM]) to produce the result of either [0:15] or [.25 hours]. I have no preference between either of these outputs.
Any thoughts on how to do this would be appreciated. I would gladly scrap the event driven approach if someone has a better idea.