Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 7054 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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:)

Posted (edited)

Make "task_begin" & "task_end" timestamp fields instead of time fields, then use the following:

GetAsTime ( task_end - task_begin )

Edited by Guest
Posted (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 by Guest
Posted

Timestamp option is a new feature of the FM7

Posted (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 by Guest
Posted

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!

Posted

Try this:

(task_endDate - task_startDate) * 86400 + task_endTime - task_beginTime

Make sure calculation result is "Time"

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.