duration in hours format
shweta
Member Posts: 94
I have taken a variable say temp of duration where value are calculated as temp:=(to time-from time).to time and from time both are of time data type.If result is coming as 3 hrs 29 min 50 sec
then i want it to be displayed as 3.49 hrs
How i can do it
Please help me
then i want it to be displayed as 3.49 hrs
How i can do it
Please help me
0
Comments
-
The time is displayed according to your setup done for Time in the Regional and Language Options from your Control Panel.0
-
Hello,
You can do this by using an int variable for subtracting time. If you have variables time1 and time2 of TIME type then the rezult of (time2 - time1) will be expressed in milliseconds. So, in order to achieve what you want - to express the rezult in hours - you have to divide the integer by 1000 * 60 * 60.
Exemple:
Name DataType Subtype Length
Time1 Time
Time2 Time
Int IntegerTime1 := 103020T; Time2 := 113000T; Int := Time2 - Time1; MESSAGE('%1',Int/3600000);
I hope this will help you.//Bogdan0 -
Thanks for the suggestion it is working fineBBlue wrote:Hello,
You can do this by using an int variable for subtracting time. If you have variables time1 and time2 of TIME type then the rezult of (time2 - time1) will be expressed in milliseconds. So, in order to achieve what you want - to express the rezult in hours - you have to divide the integer by 1000 * 60 * 60.
Exemple:
Name DataType Subtype Length
Time1 Time
Time2 Time
Int IntegerTime1 := 103020T; Time2 := 113000T; Int := Time2 - Time1; MESSAGE('%1',Int/3600000);
I hope this will help you.0 -
You are welcome
//Bogdan0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions