Plataan - Microsoft Dynamics - Learning & Competence Management Vincent Bellefroid Koen Stox Steven Renders Conny Schuddinck Steffie Alexiou
A blog about Microsoft Dynamics
Home Archives Subscribe Plataan website

« How to set trace flag 4616 in Sql Server ? | Main | Microsoft Dynamics NAV Test Drive »

08/11/2007

Substract values with Time datatype in Microsoft Dynamics NAV

I received a number of questions lately from students on how to substract two values in fields or variables of the dataype Time.

1. Assume you have 3 variables:
- " Start Time": Datatype = Time (09:00)
- "Ending Type": Datatype = Time (17:00)
-  "Total Hours": Datatype = DECIMAL
Solution:
"Total hours":=("End Time"-"Start Time")/3600000;
"Total hours" will be 8

2. Assume you have 3 variables:
- " Start Time": Datatype = Time (09:00)
- "Ending Type": Datatype = Time(17:00)
-  "Total Hours": Datatype = DURATION
Solution:
"Total hours":="End Time"-"Start Time";
"Total hours" will be 8 hours

Short one but I hope it helps :-)!

Comments

The comments to this entry are closed.

October 2011

Mon Tue Wed Thu Fri Sat Sun
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Plataan Community

Visit us on LinkedIn Visit us on Facebook Visit us on Twitter