Time + Time

Hi,

    I'm working with Nav 5 and need to sum Time + Time, but and error is displayed (can't sum Time + Time)...

How can I do it?, it's just 5:00 + 3:00 = 8:00, I can't believe it doesn't work !!

Thanks

Parents
  • Hi,

        I'm working with Nav 5 and need to sum Time + Time, but and error is displayed (can't sum Time + Time)...

    How can I do it?, it's just 5:00 + 3:00 = 8:00, I can't believe it doesn't work !!

    Thanks


     

    I can't in my mind concieve of what it means to have 3am plus 5 am, something like saying what is 25 deg C + 22 Deg C, is the correct answer :

    47 or  320 or 593.

    Since the question poses no logic, all three answers are potentially correct, though in my mind the correct answer would be 320 Deg C.
     

     But if you want to get the number, then the formula is.

    NewTime := 050000T + (030000T - 000000T);

    So if you want TimeC, the sum of times TimeA and TimeB

    TimeDif := TimeA + (TimeB - 000000T);

     

    Now can you explain what you are using this for.Cool
     

  • OK, so in fact it has nothing to do with adding up times, but adding up durations. I.e you want to know if oneperson worked 3 hours, and one person worked 5 hours, how many hours in total were worked.  In which case my formula works so what's the problem?

    But keep in mind that time is not really what you want, so when you say "I can't believe Navision can't do that" its not that Navision can't do it. its just that its just not possible what you want.

     

    Imagine a scenario for example where one person works 10 hours, one 8 hours and one 9 hours, that is a total of 27 hours of work, but if you represent it as time, then it will be 3:00AM not really indicative of what you are expecting.

     

    Point is that a time variable is the wrong way to represent this.
     


     

  • Reply Children
    No Data
    Related
    Recommended