Remove milliseconds from duration variable

CobaltSS
Member Posts: 137
Hi,
I would like to remove the milliseconds portion of a duration variable on a report. Any ideas greatly appreciated.
cheers,
I would like to remove the milliseconds portion of a duration variable on a report. Any ideas greatly appreciated.
cheers,
0
Answers
-
-
Thanks for the quick reply, Harry,
However, that solution doesn't address the problem (although I think I'll use it elsewhere). For this application, I just need to show the duration as x days, y hours, z minutes. The time format doesn't really do this for me. All I need here is to strip the milliseconds (and seconds, if possible) from the report. Is there another way?
cheers,0 -
All it takes to show the duration in 'hh:mm:ss' notation is to create a time variable (timeDuration) and then do the following:
timeDuration := 000000T + durDuration;
I don't work at all with time but when I read this I figured it was just about adding or dividing it out :-k
I assume you've tried the FORMAT command
example
MESSAGE('%1',FORMAT(YourTime,4,1);
See help for more info
FORMAT(YourTime,'<Hours12,2>:<Minutes,2>:<Seconds 0 dec.> <AM/PM>');0 -
When I add the 0T to the Duration variable it does convert it to a time. But the Duration variable is not a TIME data type, it's a DURATION data type. It's created (in my case, anyway) by subtracting one datetime data type from another datetime datatype. When it prints on the report it prints 9 days, 9 hour, 9 minutes, 9 seconds, 999 milliseconds. For my purposes, I only need to see down to the minutes. (The time result is 9:09:09.999 (I think) when I add the Duration datatype to 0T).
cheers,0 -
try format???
See help for more info
FORMAT(YourTime,'<Hours12,2>:<Minutes,2>:<Seconds 0 dec.> <AM/PM>');
delete the sconds part if you don't want it.0 -
MyDuration := ROUND(MyDuration,1000); // The simpler the better 8)Regards
Peter0 -
Nicely done.
Thanks very much.
cheers,0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions