bens Posted May 2, 2007 Posted May 2, 2007 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
Søren Dyhr Posted May 2, 2007 Posted May 2, 2007 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
bens Posted May 2, 2007 Author Posted May 2, 2007 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.
Søren Dyhr Posted May 2, 2007 Posted May 2, 2007 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
bens Posted May 2, 2007 Author Posted May 2, 2007 The metaphor i understand, but how will it be better with script control with date sorting ? Verden er "lille", kender firmaet.
Søren Dyhr Posted May 2, 2007 Posted May 2, 2007 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
bens Posted May 8, 2007 Author Posted May 8, 2007 Is it possible to subtract the time from ours day, if the case is cleaning ? Worktime should still be plus.
Søren Dyhr Posted May 8, 2007 Posted May 8, 2007 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
Vaughan Posted May 9, 2007 Posted May 9, 2007 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.
Recommended Posts
This topic is 6505 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