|
-
August 7th, 2009, 05:31 AM
#1
calculate the time
I need a formula to calculate the difference in Hours and Minutes between two times.
Example: Table name = Attandance and the fields that need to be calculated are:
[IN] = 1:15 PM
[OUT] = 1:44 PM.
Show Result 0:29.
Thanks In Advance.
-
August 7th, 2009, 11:18 AM
#2
Re: calculate the time
local numbervar sec:=datediff("s",{EMP.EMP_INS_YMDHMS},{DEPT.DEPT_INS_YMDHMS});
local numbervar days:=0;
local numbervar hr:=0;
local numbervar min:=0;
local numbervar calc;
calc:=truncate(sec/(24*3600));
days:=calc;
calc:=truncate(sec/3600);
hr:=calc;
calc:=truncate(sec/60);
min:=calc;
sec:=sec mod 60;
totext(days)+"Day "+totext(hr) +"Hrs "+totext(min)+"Min "+totext(sec)+"Sec";
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|