s.delikostov is correct. You should make your field sum into an Integer type.
As s.delikostov, said Navision calculates the difference between 2 times as milliseconds.
You can then convert the milliseconds into hours.
You shouldn't have Break as a time field though. You should make a new field called "Break in Minutes" (or something like that).
Then work out the difference between Start Time and End Time. Convert that to minutes. Subtract "Break in Minutes", this will return total time taken in minutes. You can then convert that to hours if that is what you need.
-- EDIT --
When converting from Seconds to minutes (and to hours) you will need to use a decimal field as you will be incurring decimals.
Eg: In your example, when you eventually reach your answer it will be 3.5 (hours), therefore you will need a decimal.
This isn't a signature, I type this at the bottom of every message
Comments
Navision Solution Developer
Intelligent Systems Bulgaria
Navision Solution Developer
Intelligent Systems Bulgaria
Endtime = 12:00
Break = 00:30
The Difference is:
sum=Endtime-Startime-Break
sum=12:00-08:00-00:30
sum=3:30 (hours)
thats what i want to create
As s.delikostov, said Navision calculates the difference between 2 times as milliseconds.
You can then convert the milliseconds into hours.
You shouldn't have Break as a time field though. You should make a new field called "Break in Minutes" (or something like that).
Then work out the difference between Start Time and End Time. Convert that to minutes. Subtract "Break in Minutes", this will return total time taken in minutes. You can then convert that to hours if that is what you need.
-- EDIT --
When converting from Seconds to minutes (and to hours) you will need to use a decimal field as you will be incurring decimals.
Eg: In your example, when you eventually reach your answer it will be 3.5 (hours), therefore you will need a decimal.
Which command do i have to use to convert it to hours?
sum=14400000
hours=14400000/3600000=4
Navision Solution Developer
Intelligent Systems Bulgaria
thank you
how can i subtract the "break" too ? I cant subtract 3 values only 2 like you described.
If it's 12:30-12:00 - this is 0.5 hours
if you enter 0:30 - this is not correct, better way is to enter it in a decimal - 0,5
Navision Solution Developer
Intelligent Systems Bulgaria
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.