How to divide the Duration data type by 2

Hi All,

how to divide the 21 hours 55 minutes 50 seconds(Duration Data type) by 2 in NAV 2013 Reports

please help me

Just like any other fields: NewDuration := Duration / 2;

Thanks Erik

by 2 its working fine but if i use by 3 it is not working it gives error

AvgTotalResTime:=TotalResTime/3; in NAV 2013 Report

Microsoft Dynamics NAV


Overflow under conversion of Microsoft.Dynamics.Nav.Runtime.Decimal18 value 52436666.6666666667 to System.Int64.


OK


[deleted]

Actually better like this:

AvgTotalResTime:=ROUND(TotalResTime/3,1);

Thanks Erik

Its working fine

Hi SubbaReddy

The error you have mentioned

“Overflow under conversion of Microsoft.Dynamics.Nav.Runtime.Decimal18 value 52436666.6666666667 to System.Int64.”

I am receiving the same error.

I am not a developer but, I was wondering if you can please guide me through. Where I can put this formula “AvgTotalResTime:=TotalResTime/2” or as Erik suggested to use “AvgTotalResTime:=ROUND(TotalResTime/3)”

Cheers
Syed

Hi Syed,
Well unless you need to divide the duration, then you should not use this formula.

The error you are getting is a quite normal programming error. So it may not even have anything to do with duration fields.

And please if it’s not related to duration/development, then ask this as a new question instead, then I’m sure somebody can help you. [:)]