James, you need a function that turns the string into seconds,
type this:
function GetSeconds(ATimeString: string): Integer;
var
Hour, Min, Sec, MSec: Word;
begin
DecodeTime(StrToTime(ATimeString), Hour, Min, Sec, MSec);
Result := Hour * 3600 + Min * 60 + Sec;
end;
In this way you can add the seconds contained in the various strings.
Then you can turn the number of seconds into string again.
function SecondToTime(const Seconds: Cardinal): Double;
var
ms, ss, mm, hh, dd: Cardinal;
begin
dd := Seconds div SecPerDay;
hh := (Seconds mod SecPerDay) div SecPerHour;
mm := ((Seconds mod SecPerDay) mod SecPerHour) div SecPerMinute;
ss := ((Seconds mod SecPerDay) mod SecPerHour) mod SecPerMinute;
ms := 0;
Result := dd + EncodeTime(hh, mm, ss, ms);
end;
If you are using Oracle you can add up using the same database functions.
SOMAR STRING as DATE - Oracle
link
link