Thank you very much rvduuren that's perfect. Just another quick question. If the duration is over one day it displays as 1 day 2 hours etc. Is there a way i can display this as 26 hours?
C/Al Help >>
BIGINTEGER
Use this data type to store very large whole numbers. This data type is a 64 bit integer. You must add an L to the constant definition to inform C/AL that the integer must be interpreted and treated as a BIGINTEGER.
DURATION
Use this data type to represent the difference between two datetimes, in milliseconds. This value can be negative. It is a 64 bit integer.
DATETIME-DATETIME=DURATION
DATETIME-DURATION=DATETIME
DATETIME+DURATION=DATETIME
Everything is going fine now thanks just one more problem. I have a datetime field that looks at the time someone clocks in. If they clock in before 6:00 the report needs to identify this and put 6:00 rather than the time they clocked in at. Any ideas?
You can use DT2TIME and DT2DATE to split the DT to DATE and TIME. After that you can test the time, correct it to 6:00 if needed and reconstruct the DT with CREATEDATETIME...
I'm looking for a little bit of clarification on the above. I've looked through the application designers guide and the Navision Financials Help and I'm a little stuck..
I understand what is explained above, however how would one do a comparison of two times and obtain a decimal representation in hours? For example:
StartTime := 0900T;
EndTime := 1500T;
So the difference should be 6 hours. I've done something very similar in Excel but im not that familiar with the date & time functions that are available within Navision.
Excel Formula
(C8-C7+(C8<C7))*24
C8 = EndTime
C7 = StartTime
So using the above would be as follows:
C8 would equate to 0.625
C7 would equate to 0.375
Which would equal 0.25. In this instance the EndTime is not less than the StartTime so we then multiply the first part of the equation (0.25) by 24 giving the answer of 6 hours.
Comments
Try :
Let me know if this is what you mean..
Rvduuren
Try: I hope this is useful for you, let me know..
Rvduuren
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
myTime := 1400T
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I'm looking for a little bit of clarification on the above. I've looked through the application designers guide and the Navision Financials Help and I'm a little stuck..
I understand what is explained above, however how would one do a comparison of two times and obtain a decimal representation in hours? For example:
StartTime := 0900T;
EndTime := 1500T;
So the difference should be 6 hours. I've done something very similar in Excel but im not that familiar with the date & time functions that are available within Navision.
Excel Formula
(C8-C7+(C8<C7))*24
C8 = EndTime
C7 = StartTime
So using the above would be as follows:
C8 would equate to 0.625
C7 would equate to 0.375
Which would equal 0.25. In this instance the EndTime is not less than the StartTime so we then multiply the first part of the equation (0.25) by 24 giving the answer of 6 hours.
Hope i make sense?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I think this might help a few other people that come across this, especially if they dont have a lot of coding experience with Navision like myself.
NB : no get on message but in a variable time3
but you must be sure that the time2 < time1.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.