Subtracting Times
Posted by Richie Turner on July 23, 2001 3:17 AM
I'm using VBA User form and would like to display the number of Days, Hours, Minutes and seconds to go until a specified date and time in the future.
I'm currently using four seperate calculations for each of the days, hours, mins, secs, using for example:
intMinsToGo = Minute([specified date & time] - Now)
and then joining them together to form a string that displays something like "8d 4h 38m 27s".
This seems to be fine until one of the results is zero. eg. if Specified date and current date falls on the same day, I'll get something like "31d 7h 12m 48s" rather than "0d 7h 12m 48s"
Anyone know how I can get round this or is there a much easier way to get the result I want.
Most grateful for any help
Richie