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.

[RESOVED] Calculation Steps help

Featured Replies

Hi guys,

I've designed a punch card solution in FM10 to help employees clock in and out.

I have a calculation field (Hours_work) that outputs the payable work hours based information collected in a weekly report.

If no clock-in time and/or clock-out time is registered, I want the Hours_work field to output 0. How do I do that? Also, does anyone see any issues with my script steps below?.

Here's the script:

Round(

(Hour( ClockOut_time - ClockIn_time )*60 + Minute( ClockOut_time - ClockIn_time)) / 60 - Hours_lunch;

2)

+

If(

GetAsNumber(ClockOut_time) <= GetAsNumber(ClockIn_time);

24;

0)

Round(

(Hour( ClockOut_time - ClockIn_time )*60 + Minute( ClockOut_time - ClockIn_time)) / 60 -

Hours_lunch;

2)

+

If

(GetAsNumber(ClockOut_time) <= GetAsNumber(ClockIn_time);

24;

0)

When the clock in time is 5:29 PM and no clock-out time is specified, the Hours_work field outputs 6.52. That's wrong. How do I fix that?

Thanks a lot

Edited by Guest

How about =


Case ( ClockIn_time and ClockOut_time ;

Round ( ( ClockOut_time - ClockIn_time ) / 3600 + 24 * ( ClockOut_time ≤ ClockIn_time ) - Hours_lunch ; 2 )

)

BTW, it's a calculation, not a script.

  • Author

Thanks bud.

Let me fire this beast and see what we got.

You're right, it's a calculation, not script

  • Author

It worked, thanks a lot.

Can I just ask you to explain why you used this line:

24 * ( ClockOut_time ≤ ClockIn_time )

Thanks

It's the equivalent of your:

If

(GetAsNumber(ClockOut_time) <= GetAsNumber(ClockIn_time);

24;

0)

  • Author

wicked!

Thanks again.

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.