How to convert Decimal value to Duration?

southindiansouthindian Member Posts: 247
Dear all,

How to convert a decimal values to Duration.

For example

if the Decimal Value is 21.8 the Actual Duration in Hours is 21 Hrs 48 Minutes.

If am using Evaluate function i was able to convert it but am Getting as follows

"21 Hours 48 Minutes". But i want in time basic like 21.48.

How to do it

Suggest me

Comments

  • kinekine Member Posts: 12,562
    Duration will be fornated as "X hours y minutes z seconds" etc. If you want to have it in different format, you need to format it yourself. If you use Time datatype, you will have it correct, but wha about time > than 24 hours? How you want to display it?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ShedmanShedman Member Posts: 194
    The NAV help says:
    Represents the difference between two DateTimes. This value can be negative. It is stored as a 64-bit integer. The integer value is the number of milliseconds during the duration.

    So it should be possible to calculate how many hours there are in the no. of miilliseconds and from the remaining no. of milliseconds you should be able to derive to no of minutes. Put a dot in between and Bob's your uncle!
  • SogSog Member Posts: 1,023
    -snip- the question was interpreted wrong. and remove is not possible
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
Sign In or Register to comment.