10 Replies Latest reply on Sep 25, 2013 11:41 PM by xtremu

    Time In and Out Problem: Please help..

    xtremu

      Title

      Time In and Out Problem: Please help..

      Post

           Hi guys, I am using Filemaker Pro 11 Advanced using Windows operating system. I have only 2 tables, Employee and AccessLog table. It's already working with time in and time out capabilities. When the employee scan or manually encode his/her number for the first time it will record the time in TIME IN field and the second time he do it, it will record the time in the TIME OUT field and then TIME IN and TIME OUT and so on.. 

           The problem I noticed is that if this person has a TIME IN and TIME OUT record for this day (Tuesday-09/10/2013) and the last record he/she did is only up to TIME IN and NO TIME OUT what happened is that the next day he/she log in that supposedly record in TIME IN for (Wednesday- 09/11/2013) will record in the TIME OUT of (Tuesday - 09/10/2013) which I found not good for the system. The date and time is not the same of what is the real scenarios happened.

           Any idea please help..

           xtremu

        • 1. Re: Time In and Out Problem: Please help..
          CekariYH

               Well, if you check for the time-span between the TIME IN 09/10/13 and TIME OUT  09/11/13 and if it's too big, open a dialog to let the user enter a date and time when he actually left "logged out" manually (he might have being there over midnight so just checking for day-change will not work).

               If the user is still logged in, the check need to be done when the user starts to do something again and the time-span from last to now is of a specified time (ie above 12h or so).

               I would have a field for each TIME IN - TIME OUT that could hold a value (ie "Manual entry") if the user added someting manually.

               After checking probability of the users entries save that to the TIME OUT and add a new record of TIME IN as well with actuall time.

                

               There is other ways too, but thats a simple one.

          • 2. Re: Time In and Out Problem: Please help..
            xtremu

                 Thanks for the quick replied CekariYH. Anyway, we dont have keyboard to use for manual entry because we are using barcode scanner.  Can we make a code that tell the system that if NO TIME END this day ( or let's say up to 12 AM) then set field to TIME Start for the next login?

            below is the screenshot of the result.

            thanks again.

            • 3. Re: Time In and Out Problem: Please help..
              CekariYH

                   Hmmm, I have no idea how the scanner puts in values into FMP, but you could make a check for last entry every time and if the last entry is a TIME OUT check it against the corresponding TIME IN for a new day or lets say 12h time-span, and if true mark a third field with a "?" and copy the last TIME OUT to a global-tempvariable ($$TempTIME) and add a new record and copy the tempvariable to the TIME IN field and commit (Save).

                   You also have to deal with if the time of day is normal or not for check-in so it's not making a new check-in if the actual check-out time is true but long.

                   Not that easy if the time for the persons vary much during a day for example shift-work or called in overtime etc. One have to take that in the math as well depending on... so to say... 

              • 4. Re: Time In and Out Problem: Please help..
                philmodjunk

                     Seems like You'll need some means of providing additional input to tell FileMaker what to do. Perhaps with a special Barcode that FileMaker can detect as telling it to do what you want here.

                     (Unless you are using an iOS device, Barcode readers usually function in keyboard emulation mode--the computer thinks the scanned data was typed in you can even use a scanner to trip script triggers such as OnObjectModify, ONLayoutKeystroke or OnObjectExit.)

                • 5. Re: Time In and Out Problem: Please help..
                  xtremu

                  CekariYH thanks for the patience of giving ideas, I have no problem with putting value in the scanner. My only concern was how the system understand that this is a new day, and so transactions must start in TimeStart eventhough other people have no TimeEnd the other day. Like the screenshot above after September 10 even some of them has no TimeEnd, then the September 11 all individual transaction should start at TimeStart field as their first entry.

                        

                       Thanks

                       xtremu

                        

                  • 6. Re: Time In and Out Problem: Please help..
                    philmodjunk

                         After go to record[last]....

                         If [accessLog::Date ≠ Get ( CurrentDate ) // date in log is for a different day than today's date, person failed to log out the previous day ]

                    • 7. Re: Time In and Out Problem: Please help..
                      CekariYH

                           Yes, as Phil suggested.

                           If true then 1st put in a remark in a remark (or in TimeOut) fileld that TimeOut is missing, then add a new record and put the value in TimeIn?

                      • 8. Re: Time In and Out Problem: Please help..
                        xtremu

                             Thanks guys but it doesn't work here, why? 

                             xtremu

                        • 9. Re: Time In and Out Problem: Please help..
                          philmodjunk

                               That wasn't what I had in mind.

                               With your current script, if the dates match, your script does nothing. If the dates do not match, you need to handle this as an error and do what you need to handle the case when a person has failed to log out the previous day.

                               Then you insert an Else and the rest of your code can kick in for when the person correctly logged out the previous day.

                               And the test in the IF step really should be:

                               If [ accessLog::Date ≠ Get ( CurrentDate ) and IsEmpty ( AccessLog::TimeEnd ) ]

                                  #Do what is appropriate for when the user failed to log out the previous day.

                               Else

                                  #Current code goes here.

                               End IF

                          • 10. Re: Time In and Out Problem: Please help..
                            xtremu

                                 Thanks Phil, good idea and was able to figure out my errors..Great..

                                 xtremu