Hi All,
It is possible to calculate Time variable? I mean I'd like to increment a Time field with a variable of Time Type. :?
I've got an error message when I tried to add 2 Time variable. But in this case how can I cumulative two Time field with each other?
Thank you!
Comments
One can only add interval to a date, or subtract an interval from a date.
To get an interval you need to subtract one date from another or specify the interval implicitly in CALCDATE function.
It means:
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Eugene, thanks you too.
"Type conversion is not possible because 1 of the operators contains an invalid type"
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
// 03:20 = (3 * 60 minutes) + 20 minutes = 200 minutes
// 200 minutes = 200 * 60 seconds = 12 000 seconds
// 12 000 seconds = 12 000 * 1000 milliseconds = 12 000 000 milliseconds
varInteger := (3 * 60 + 20) * 60 * 1000; // desired time specified in milliseconds.
varDuration := var varInteger;
varTime := 0000T + varDuration;
MESSAGE(FORMAT(varTime)); // result is 03:20:00
So simply add some duration period in milliseconds to zero time and calculating a new time.
Thank's !!!
Devendra Sharma