Skip 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.

Calculate total worktime

Featured Replies

I'm working on a database that register the work time.

I have set a start time and a finish time for each case.

What i want is to count the ours of different cases, and the total of each day minus lunch time.

If put in a new start time the count says 9 ours, how can i get a count time only if there is a finish time.

If anyone has a better idea how to make the database please let me know.

I have attached the file.

register.fp7.zip

This way:

Case(not(2-Count(Start;finish));

Round(

Hour( finish - Start ) + Minute( finish - Start ) / 60 ;

2)

+

If(

GetAsNumber(finish) ≤ GetAsNumber(Start);

24;

0))

Then should you turn your calculation an unstored calc'field instead. There is no point in Sum( in the ralated table, since it will only show first related records sum if shown in main layout.

Then isn't there much point in showing the date in each portal line, since it's the same as the above ...the problem is that the user might move a registration to another date, which might be the intention?

But the metaphor sucks, since data is removed unannounced from the users view, simply by fiddling with the popup, such matters should instead be under script control allowing the user to regret his/her dealings.

Finally is GetAsNumber(finish) ≤ GetAsNumber(Start) a bit overkill, as long as the fields are of same type (well not container obivously) are comparisons posible without typecasts.

--sd

BTW With the kind of Cockney found in your template and message, should you post your questions here:

http://fmforum.filemakercenter.dk/phpBB2/index.php

registerMod.zip

  • Author

Thanks for the quick reply, Søren

This part i don't understand:

"
But the metaphor sucks, since data is removed unannounced from the users view, simply by fiddling with the popup, such matters should instead be under script control allowing the user to regret his/her dealings.

Try to read the reasoning made here:

http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGHIDesign/chapter_5_section_2.html#//apple_ref/doc/uid/TP30000353-TPXREF107

Hedensted, jeg har abejdet i Løsning hos Nordic!!!!

--sd

  • Author

The metaphor i understand, but how will it be better with script control with date sorting ?

Verden er "lille", kender firmaet.

The metaphor i understand, but how will it be better with script control with date sorting ?

Check the tiny mod. I made!

--sd

registerMod2.zip

  • Author

Thank you Søren

  • Author

Is it possible to subtract the time from ours day, if the case is cleaning ? Worktime should still be plus.

Yes it is, just fledge your calc' further:

Let(theVar=

Case(not(2-Count(Start;finish));

Round(

Hour( finish - Start ) + Minute( finish - Start ) / 60 ;

2)

+

If(

finish ≤ Start;

24;

0));Case ( PatternCount ( _Case ; "Cleaning" );-1;1) * theVar)

...please note that I have renamed your field "Case" into "_Case" ...

--sd

Don't forget to include start and finish DATEs into your calculation, otherwise a person starting at 9:00 am and working late to 2:00 am will have done -7 hours of work.

Soren's calculation traps for it, but it assumes just one day has passed.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.