Hi
Does your time field have dates in them or just time information,What you can do is convert all the time values i.e.
Hours
Minutes
to seconds for each the time or date time values you need and add them so you will get the output in seconds once done convert the seconds to hh:mm:ss format.....
Cheers
Rahul
This is how you do it.....
Create formula to convert the time format to seconds
local numbervar hours;
local numbervar minutes;
local numbervar seconds;
// Parse out the hours portion of the string and
// multiply by 3600 to convert to seconds
// Parse out the minutes portion of the string and
// multiply by 60 to convert to seconds
// Parse out the seconds
// Add up all the seconds
hours + minutes + seconds;
Do these for both time fields once done add the output of converted time i.e. seconds
Once done convert the Seconds to Time format creating another formula
local numbervar RemainingSeconds;
local numbervar Hours;
local numbervar Minutes;
local numbervar Seconds;
//divide the @TotalSeconds by 3600 to calculate
// hours. Use truncate to remove the decimal portion.
// Subtract the hours portion to get RemainingSeconds
// Divide RemainingSeconds by 60 to get minutes.
// Use truncate to remove the decimal portion.
Minutes := truncate(RemainingSeconds/60);
// Subtract the Hours and Minutes and what is left
// over is seconds.
Seconds :=
{@Totalsecs} - (Hours * 3600) - (Minutes * 60);
// Format the hours, minutes, and seconds to hh:mm:ss
totext(Hours,"00") + ":" + totext(Minutes,"00") + ":" + totext(Seconds,"00");
Cheers
Edited by rahulwalawalkar - 17 Feb 2009 at 7:59am