How to get duration in time between 2 time

jlett
Member Posts: 9
f_duree(VAR _heuredebut : Time;VAR _heurefin : Time) _duree : Time
// _Duree en hh:mm:ss
IF (_heurefin<>0T) AND (_heuredebut <> 0T) THEN BEGIN
_duration := _heurefin-_heuredebut; // duration = integer
_duree := 000000T + _duration; // ***** not _Duration + 0000T ****** ](*,) INCREDIBLE !!!
END;
// _Duree en hh:mm:ss
IF (_heurefin<>0T) AND (_heuredebut <> 0T) THEN BEGIN
_duration := _heurefin-_heuredebut; // duration = integer
_duree := 000000T + _duration; // ***** not _Duration + 0000T ****** ](*,) INCREDIBLE !!!
END;

0
Comments
-
So you're saying that "Time + Duration" works, and "Duration + Time" does not? That is incredible.
I don't think I would have tried reversing it like that, good catch =D>0 -
It have meaning... result data type is determined by first parameter... it means that T + D = T, D + T = D and it means that Duration + Time is nonsense... ;-)0
-
That makes no sense at all to me. A Duration plus a time can't make another duration, that is ridiculous. You can increase or decrease a duration only by adding/subtracting another duration. 2 hours plus 2 hours equals 4 hours. You can't say 2 hours plus November 8 2008 makres another duration, that makes absolutely no sense at all.0
-
it makes no sense, it is how the C/SIDE works... but it is just my though... ;-)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