Nov 7, 2002 #1 fkwong Programmer Joined Jul 5, 2002 Messages 65 Location US How to calculate two datetime values to get a turnaround time in HH:MM. I try CTOT("12:51:54"-CTOT("08:07:13"/3600 = 4.7447 which is not correct. Thanks for your help.
How to calculate two datetime values to get a turnaround time in HH:MM. I try CTOT("12:51:54"-CTOT("08:07:13"/3600 = 4.7447 which is not correct. Thanks for your help.
Nov 7, 2002 #2 wgcs Programmer Joined Mar 31, 2002 Messages 2,056 Location EC First, remember operator precedence: CTOT("12:51:54"-CTOT("08:07:13"/3600 = 4.7447 will divide first... you want: ( CTOT("12:51:54"-CTOT("08:07:13" ) /3600 = 4.7447 Upvote 0 Downvote
First, remember operator precedence: CTOT("12:51:54"-CTOT("08:07:13"/3600 = 4.7447 will divide first... you want: ( CTOT("12:51:54"-CTOT("08:07:13" ) /3600 = 4.7447
Nov 7, 2002 Thread starter #3 fkwong Programmer Joined Jul 5, 2002 Messages 65 Location US Yes, but the result should be close to 4 hour and 44 minutes right? Upvote 0 Downvote
Nov 7, 2002 1 #4 rgbean Programmer Joined Nov 9, 2000 Messages 5,707 Location US Yes, and 60 * 0.7447 is 44.6820 minutes! 4.7447 is hours, so to get the minutes, take the fractional hours and multiply by the 60 minutes in an hour. Rick Upvote 0 Downvote
Yes, and 60 * 0.7447 is 44.6820 minutes! 4.7447 is hours, so to get the minutes, take the fractional hours and multiply by the 60 minutes in an hour. Rick
Nov 7, 2002 1 #5 ramani Programmer Joined Mar 15, 2001 Messages 4,336 Location AE HI t1=DATETIME() t2=DATETIME() d1 = t2-t1 && difference in seconds hh= FLOOR((t2-t1)/3600) mm= FLOOR((t2-t1)/60)-hh*60 ss=MOD(t2-t1,60) ? STR(hh,2)+":"+STR(mm,2)+":"+STR(ss,2) ramani (Subramanian.G),FoxAcc, ramani_g@yahoo.com Upvote 0 Downvote
HI t1=DATETIME() t2=DATETIME() d1 = t2-t1 && difference in seconds hh= FLOOR((t2-t1)/3600) mm= FLOOR((t2-t1)/60)-hh*60 ss=MOD(t2-t1,60) ? STR(hh,2)+":"+STR(mm,2)+":"+STR(ss,2) ramani (Subramanian.G),FoxAcc, ramani_g@yahoo.com
Nov 7, 2002 #6 Mike Gagnon Programmer Joined Apr 6, 2002 Messages 8,067 Location CA Rick Yes, and 60 * 0.7447 is 44.6820 minutes! 4.7447 is hours, so to get the minutes, take the fractional hours and multiply by the 60 minutes in an hour. I knew how to do it, but I never seen the explanation written out. You get my mark.TKS Ramani Ramani always "le mot juste" (loose translation "always the right word" You get my mark. Mike Gagnon If you want to get the best response to a question, please check out FAQ184-2483 first Upvote 0 Downvote
Rick Yes, and 60 * 0.7447 is 44.6820 minutes! 4.7447 is hours, so to get the minutes, take the fractional hours and multiply by the 60 minutes in an hour. I knew how to do it, but I never seen the explanation written out. You get my mark.TKS Ramani Ramani always "le mot juste" (loose translation "always the right word" You get my mark. Mike Gagnon If you want to get the best response to a question, please check out FAQ184-2483 first