Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Rounding start and finish times

Featured Replies

I have a time card database which employees clock in and clock out of.

 

Currently the fields TimeStart and TimeEnd hold the exact time that someone arrives and 'clocks in or out'.  The problem with this is that each employee has a standard starting and finishing time and overtime is really only meant to be paid when overtime has been requested or required on a job. Coming in 10 minutes early to work does not constitute overtime.

 

So I would like to simplify the calculation of total hours for the day by rounding the TimeStart and TimeEnd fields to 15 minute intervals - rather than just rounding the total time spent for the day.

 

In this way - if someone clocks in 10 minutes early (eg 7:50am), the start time will still round to 8am, but if they clock in a full 15 minutes early they will clock in at 7:45am. So i guess the rule would be that if the normal starting time is 8am, if they clock in any time between 7:46 and 8:00am, the start time rounds to 8am. 

 

If the employee is late and clocks in at 8:05 instead of 8am, then the same rule will apply - and the start time will round to 8:15am.

 

Different employees have different set starting times so I think i will also need to have a table attached to employees which lists standard start and finish times and total hours for week.

 

Can anyone help me with a formula for rounding in this way please?

In this way - if someone clocks in 10 minutes early (eg 7:50am), the start time will still round to 8am, but if they clock in a full 15 minutes early they will clock in at 7:45am. So i guess the rule would be that if the normal starting time is 8am, if they clock in any time between 7:46 and 8:00am, the start time rounds to 8am.

 

What if they clock in at 7:35? Will you still round this up to 7:45? If yes, then the "standard" start time is irrelevant - you are simply rounding the actual start time up to the nearest quarter hour =

Ceiling ( StartTime / 900 ) * 900

The problem with this is that each employee has a standard starting and finishing time and overtime is really only meant to be paid when overtime has been requested or required on a job.
As per your question, you need to define the EntryTime and ExitTime on the user table, it should be predefined.
Also you need to define global fields, which will store UserId, EntryTime and ExitTime.
Then in script,
Now, you should use the step SetField in your script, using Case statement in solution,
here you need to compare the EntryTime stored in Global field, with the exact EntryTime which is associated with the user. And round it however you want.

Here is the logic, if you need full calculation, then you need to send a demo file to me.

  • Author

Comment - yes you are right - the standard time is irrelevant -  all times will be rounded to 15 min, so if an employee logs in at 7:35am (when their normal start time is 8am), the start time will be rounded up to 7:45am.

 

Can i ask what Ceiling is?

  • Author

One more question - for the TimeEndRounded, how do I alter the calculation so that it rounds down to the nearest 15 mins?

 

Many thanks

Ah! There is obviously an opportunity for a Wall() function in FileMaker.

 

Any idea what it would do?

I believe you may have opened a door to something...

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.