merkaba22 Posted October 7, 2005 Posted October 7, 2005 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:)
Kent Searight Posted October 7, 2005 Posted October 7, 2005 (edited) Make "task_begin" & "task_end" timestamp fields instead of time fields, then use the following: GetAsTime ( task_end - task_begin ) Edited October 7, 2005 by Guest
merkaba22 Posted October 7, 2005 Author Posted October 7, 2005 (edited) 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, 2005 by Guest
merkaba22 Posted October 7, 2005 Author Posted October 7, 2005 (edited) 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, 2005 by Guest
Kent Searight Posted October 7, 2005 Posted October 7, 2005 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!
merkaba22 Posted October 7, 2005 Author Posted October 7, 2005 Thanks once again -- but there is no GetAsTime calc available in FM6
Kent Searight Posted October 7, 2005 Posted October 7, 2005 Try this: (task_endDate - task_startDate) * 86400 + task_endTime - task_beginTime Make sure calculation result is "Time"
Recommended Posts
This topic is 7054 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now