Options

How is the best way to calculate the time...

FranklinFranklin Member Posts: 253
edited 2011-10-18 in NAV Three Tier
How is the best way to calculate the time it takes to place an order, since it was created until it is registered?

I have created two fields of type TIME. One is informed OnInsert trigger and the other when you register it and then, subtract from each other but the result I get weird numbers ...

X example...

Since time = 11:29:37,197
To time = 11:31:18,23

Total = 101032

:-k

This result isn´t valid for me... I want the result in seconds for example...

Comments

  • Options
    jmagnojmagno Member Posts: 15
    try applying the time conversion from millisecond to second... multiply the result in 0.001
  • Options
    FranklinFranklin Member Posts: 253
    Ohhhh the results is in milisenconds... ](*,)

    I´ll ty... thx a lot!!
  • Options
    DenSterDenSter Member Posts: 8,304
    There's also a 'duration' data type, see if that is what you need.
  • Options
    kinekine Member Posts: 12,562
    Do you really think that just time is enough? What about before and after midnight? I will use datetime and duration for this...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    FranklinFranklin Member Posts: 253
    DenSter wrote:
    There's also a 'duration' data type, see if that is what you need.

    Mmmm i don´t know this function... let me see...

    Kine the operations are around 3 or 4 minutes... not more... i think time is enough thx!!

    EDIT: DenSter this datatype is perfect... it´s just i was triyng to find!!!
  • Options
    David_SingletonDavid_Singleton Member Posts: 5,479
    Franklin wrote:

    Kine the operations are around 3 or 4 minutes... not more... i think time is enough thx!!


    A short cut is the longest path between two points. Your laziness may save time now, but it will come back and bite you in the future.
    David Singleton
  • Options
    kinekine Member Posts: 12,562
    Ok, 3 minutes, are you sure that it will not be 23:59 and 00:01?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    FranklinFranklin Member Posts: 253
    Finally i´m using a field dataype duration as DenSter said... it´s perfect!!

    Thx Kine and David Singleton too!!
  • Options
    DenSterDenSter Member Posts: 8,304
    Cool, now all you need to do is make sure that you listened to Kamil and David, and implement datetime data types instead of just Time.
  • Options
    FranklinFranklin Member Posts: 253
    Sure!!

    :thumbsup:
Sign In or Register to comment.