AnsweredAssumed Answered

Adding Time

Question asked by timacadia on Jul 16, 2014
Latest reply on Jul 17, 2014 by timacadia


Adding Time


     I'm trying to make a simple Appointment type calendar, nothing complicated,  You fill in the time and date and it shows on a portal on the main screen of our DB, we want to see easily when one of our people is at an appointment etc.

     I have time entry split into 3 fields, Hour, Min and Am or PM.   I also have a section for Drive time  (we bill different rates for drive time so it's essential we can easily see it)

     I want to be able to create a field that incorporates an Out of Office from\to   which incorporates the actual onsite times and the drive time  but when I run the script to do the calculation i get a gibberish answer??   any help

     Script is:    the first section that builds the time from the 3 sep numbers works fine, it's the subtraction of travel time that messes everything up

     TimeFr =

      (Calendar::TimeFrHR & ":" & Calendar::TimeFrMin & Calendar::TimFrAP) - 60 * Calendar::TravelTime


     so if we have TimeFrHR = 9 TimeFrMin = 15 TimeFrAP= AM   this sets TimeFr to 9:15AM perfectly as it should be

     however when i then add the - 60*Traveltime (which from what I searched before SHOULD subtract x mins from the time.    the field output becomes some gibberish number  For instance  If I set TravelTime  to 15  (being 15 mins)  the output instead of showing 9:00AM  becomes 0:00:15.  setting TravelTime to 25 makes the answer  -0:09:45

     TravelTime is a Number Field

     TimeFr is a Time Field