May 2, 200718 yr 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
May 2, 200718 yr 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
May 2, 200718 yr 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.
May 2, 200718 yr 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
May 2, 200718 yr Author The metaphor i understand, but how will it be better with script control with date sorting ? Verden er "lille", kender firmaet.
May 2, 200718 yr 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
May 8, 200718 yr Author Is it possible to subtract the time from ours day, if the case is cleaning ? Worktime should still be plus.
May 8, 200718 yr 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
May 9, 200718 yr 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