October 7, 200520 yr I have a basic solution for calulating the time it takes for a task: task_begin (insert current time) for login and task_end (insert current time) where (task_end) - (task_begin) = total time -- with some calcs for rounding, etc. Where I need to refine this is when the task-end crosses over midnight and I start getting negative numbers... I could really use a calc to deal with this eventuality .... thanks in advance:)
October 7, 200520 yr Make "task_begin" & "task_end" timestamp fields instead of time fields, then use the following: GetAsTime ( task_end - task_begin ) Edited October 7, 200520 yr by Guest
October 7, 200520 yr Author Hey thanks Kent_S; I really appreciate the tip but I don't see an option for a timestamp field in FM 6 -- when I use FM Help, there is no reference to this field type. What am I missing? Edited October 7, 200520 yr by Guest
October 7, 200520 yr Author I appreciate the clarity -- thank you. So ... it seems I can get DayofYear when I simultaneously insert Current time in task_begin and, later, in task_end via a script. Then if the differential between the two DayofYear values is a whole number I can multiply by 24; And add in the negative difference between task_begin and in task_end when crossing midnight to get the true duration of time.. Is this the easiet way to accomplish this calculation in FM 6? Edited October 7, 200520 yr by Guest
October 7, 200520 yr Yikes, sorry, I hadn't noticed you were using FM6. Try this: GetAsTime ( task_endDate - task_beginDate ) * 86400 + task_endTime - task_beginTime To set this up you'll need to create 2 date fields that get the current date(s) of the task's start and finish dates. You'll also need to format your time field for a 24 hour clock. Note: I jumped from FM4 to FM7 so I don't have a FM6 to refer to in front of me, but I think everything will work for you in FM6. Best of luck to you!
October 7, 200520 yr Try this: (task_endDate - task_startDate) * 86400 + task_endTime - task_beginTime Make sure calculation result is "Time"
Create an account or sign in to comment