Hi
This is what you do create the formulas below,
I have shown you for start time repeat the same steps for End Time
Frm_StartTime_Hrs
if LEFT({Parent_Child.FinishTime},2)= '0' or LEFT({Table.StartTime},2)= ' '
then
0.00
else
tonumber(LEFT({Table.StartTime},2))
Frm_StartTime_Mins
if Right({Table.StartTime},2)= '0' or Right({Table.StartTime},2)= ' '
then
0.00
else
tonumber(Right({Table.StartTime},2))
Once done
Create another set of formulas to convert the time to seconds
Convert StartTimeHoursMins
local numbervar hours;
local numbervar minutes;
// Parse out the hours portion of the string and
// multiply by 3600 to convert to seconds
hours := {@Frm_Frm_StartTime_Hrs}* 3600;
// Parse out the minutes portion of the string and
// multiply by 60 to convert to seconds
minutes := {@Frm_Frm_StartTime_Mins} * 60;
// Add up all seconds
hours + minutes
this will give you output in seconds
Repeat the above steps for End Time
Once done Subtract the
Convert EndTimeHoursMins from Convert StartTimeHoursMins call this formula as diff_time
you will get the output in seconds use the final formula
Frm_Final
local numbervar RemainingSeconds;
local numbervar Hours ;
local numbervar Minutes;
//divide the @TotalSeconds by 3600 to calculate
// hours. Use truncate to remove the decimal portion.
Hours := truncate({@diff_time} / 3600);
// Subtract the hours portion to get RemainingSeconds
RemainingSeconds := {@diff_time} - (Hours *3600);
// Divide RemainingSeconds by 60 to get minutes.
// Use truncate to remove the decimal portion.
Minutes := truncate(RemainingSeconds/60);
// Format the hours, minutes, and seconds to hh:mm:ss
totext(Hours,"00") + ":" + totext(Minutes,"00")
Cheers
Rahul