The following will calculate from your start time code and end time code the total difference in frames between the two - from there we can calculate the total seconds to be used in a dateadd and then add the remaining frames on to the end of that.
Change the startcode and endcode variables to the relevant fields in your table.
stringvar startcode:="02341223";
stringvar endcode:="02341422";
numbervar array s;
numbervar array e;
numbervar x;
numbervar array f:= [90000,1500,25,1];
redim s[4];
redim e[4];
for x:= 1 to 4 do (
s[x] := tonumber(mid(startcode,(x*2)-1,2))*f[x];
e[x] := tonumber(mid(endcode,(x*2)-1,2))*f[x];
);
numbervar framedif:= sum(e) - sum(s);
numbervar secdif:= truncate(framedif/25);
Numbervar rframes:= remainder(framedif,25);
totext(dateadd("s",secdif,#00:00:00#),"HH:mm:ss")&":"&totext(rframes,0,"")
If you have other fields in your database that give you the frame number rather than us trying to calculate is from the timecode you've created the only thing you need of that is the last 4 lines, slightly modified ofcourse.
Regards,
Ryan.
Edited by rkrowland - 22 May 2012 at 12:53am