### Title

Carrying over a finish time to the next record start time but adding 1 minute

### Post

I have a field StartTime that has an OnObjectEnter script trigger thus:

[IMG]http://i56.tinypic.com/15n6at2.jpg[/IMG]

which takes the previous record's FinishTime and puts it in the StartTime of the next record if it's empty, but enables me to adjust it if needed.

It is also has an AutoEnter calculation that I grabbed from somewhere else here on the forum thus:

Let ( [ nums = Filter ( StartTime ; "0123456789" ) ; chars = Filter (Upper ( StartTime ) ; "AMNP" ) ; lgthN = Length ( nums ) ; lgthC = Length (chars ) ; numTest = Case ( GetAsNumber ( nums ) < 1260 ; 1 ; GetAsNumber (nums ) < 2360 ; 2 ; 0 ) ; charTest = Case ( lgthC > 0 and lgthC < 3 ; 1 ; 0 ) ; mins = Case ( lgthN > 2 ; Right ( nums ; 2 ) ; "00" ) ; hrs = Case ( lgthN > 2 ; Middle ( nums ; 1 ; lgthN - 2 ) ; nums ) ; hrsN = GetAsNumber ( hrs ) ; minsTest = Case ( GetAsNumber ( mins ) > 59 ; 0 ; 1 ) ; hrs12 = Case ( numTest = 2 ; GetAsText ( hrsN - 12 ) ; hrsN = 0 ; "12" ; hrs ) ; suffix = Case ( charTest = 1 and ( PatternCount ( chars ; "A" ) or Exact ( chars ; "M" ) ) ; " AM" ; charTest = 1 and ( PatternCount ( chars ; "P" ) or Exact ( chars ; "N" ) ) ; " PM" ; charTest = 0 and Exact ( Left ( nums ; 1 ) ; "0" ) ; " AM" ; numTest = 2 and hrsN > 12 ; " PM" ; "" ) ; hrsTest = Case ( GetAsNumber ( hrs12 ) > 12 ; 0 ; 1 ) ; suffixTest = Case ( hrsN > 12 and Exact ( suffix ; " AM" ) ; 0 ; 1 ) ; inter = GetAsNumber ( hrs12 & mins )] ;

Case ( numTest = 0 ; "INVALID TIME" ; minsTest = 0 ; "INVALID TIME" ; hrsTest = 0 ; "INVALID TIME" ; suffixTest = 0 ; "INVALID TIME" ; inter > 0 and inter < 700 ; Left ( inter ; 1 ) & ":" & Right ( inter ; 2 ) & If ( not IsEmpty ( suffix ) ; suffix ; " PM" ) ; inter >= 700 and inter < 1000 ; Left ( inter ; 1 ) & ":" & Right ( inter ; 2 ) & If ( not IsEmpty ( suffix ) ; suffix ; " AM" ) ; inter >= 1000 and inter < 1200 ; Left ( inter ; 2 ) & ":" & Right ( inter ; 2 ) & If ( not IsEmpty ( suffix ) ; suffix ; " AM" ) ; inter >= 1200 and inter < 1260 ; Left ( inter ; 2 ) & ":" & Right ( inter ; 2 ) & If ( not IsEmpty ( suffix ) ; suffix ; " PM" ) ; "INVALID TIME" ) )

which parses any time entry into an appropriate format (eg 1030 becomes 10:30); donot replace existing value is UNCHECKED.

I want to add one minute to the previous FinishTime and have it enter into the StartTime. I tried this

GetNthRecord ( Main::FinishTime ; Get ( RecordNumber ) -1 ) + 60

which works only if I take off the Autoenter calculation above. If I leave that in, I get a ?mark in the StartTime field for the next case.

Sorry for the complicated post. ANy help appreciated

CHeers

Chris

OK Phil...I think the alcohol and drugs helped for I HAVE SOLVED IT! The key is in that calculation - it only recognizes 4 or less numbers as a valid time (ie doesn't like seconds) and of course the mathematical manipulation of the finish time by adding 60 (seconds) is expressed as a "time" not a number and is entered thus xx:xx:xx even though the seconds are "00". I made another field that takes only the hour and minutes out of the manipulated field thus: Hour ( FinishTimePlusOneMinute ) & ":" & Minute ( FinishTimePlusOneMinute ) and then used that figure in the OnObjectEnter script.

woohoo!! I am very excited. Small victory, the results of which are reasonably insignificant. But it's the victory that counts!

Thank you for your time on this I appreciate it!!