Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Checking Existing Time/Date

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Checking Existing Time/Date

    I have a user who I have already created a table and input browse where he enters employee name, then the date they started work, then the time, then the date they stopped and the time. Based on this A5 does the calculations of total time.

    But he recently showed me where he had so many time slips coming in, that at times, one might be doubled. Or perhaps, an employee might submit an old timeslip with different times worked. What he wants is a way to check this input and if it looks like a duplicate, pop-up a message advising him and then allowing him to force the entry through if he chooses to do so. The complexity is the time hours worked.

    Let's say that EmployeeA submits a timeslip for X date saying he worked from 06:00 to 15:00. Later he submits a timeslip saying he worked from 09:00 to 19:00 on the same day. How would I find this?

    I tried to do this by using the OnChange event in the input browse, but where I got hung-up was when I am entering values and at the same time checking them against the same table. I attempted to solve this issue by using a function and sending the values to that, but it's still not working.

    Thanks for any ideas.

    #2
    Re: Checking Existing Time/Date

    well ..... most likely an employe has a unique identifying number, like employee_num. this makes it easy to determine if the employess already has a record for that day, using either dbcount() or tablecount().

    Now the employee may be working at different locations, like job 1 and job 2, which is a bit more complicated

    But if he is only working at one location, and there are two timeslips, as described, with apparently fradulent or at best conflicting entries, I would then reject both entries, and point out the discrepency to the employee, and require same to resubmit a single time slip.

    With the entries you described, if you accept only one, the employess is robbed of time; if you accept both the company is robbed.
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    [email protected]

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

    Comment


      #3
      Re: Checking Existing Time/Date

      Charles I set up a table of bookings from A..to B dates. With most problems the solution occurs as simple until you try. This was not too difficult.
      Created a filter algorithm line to check for any date conflict, and filter the existing booking/s on where there is conflict with any proposed period for the person.
      My example is a demonstration of the principle for date/time. If this is what you are after.
      Using a browse in IW
      Code:
      tb=table.current()
      per="KIOPL.CO"
      s1="20/08/2013"
      s2="21/08/2013"
      filt="cust="+quote(per)+" .and. ((adate<={"+s1+"} .and. bdate>={"+s1+"}) .or.  (adate<={"+s2+"} .and. bdate>={"+s2+"}))"
      reslt=tb.query_create("",filt)
      if reslt.records_get() >0 ' there is a conflicting existing record
           DefaultBrowse_booking.Resynch()
      end if
      The table fields are naturally Cust, Adate and Bdate

      Comment


        #4
        Re: Checking Existing Time/Date

        Is it possible someone went to work, left for some reason, and came back the same day?
        Is it possible that someone worked > 1 shift?
        What are the typical work hours? 9-5? or around the clock?

        Comment


          #5
          Re: Checking Existing Time/Date

          It is not reasonable that he worked from 06.00 to 15.00 AND 9.00 through 17.00
          Cole Custom Programming - Terrell, Texas
          972 524 8714
          [email protected]

          ____________________
          "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

          Comment


            #6
            Re: Checking Existing Time/Date

            Thanks for the suggestions and ideas. I guess what I am looking for is how to lookup something which is being input within the table you are inputting to. I was thinking something along the lines of using the exist function within the field rules along with the between function.

            As for how this could happen, I thought at first that it was kind of impossible along the lines of what Martin was saying. However, in this company, they have hundreds of employees scattered around the State of NJ, and some people, quite frankly forget that they already sent in a timesheet for certain times. I've even seen ones where the employee changes the original times that they were already paid for. That's why they asked me to come up with some kind of solution, so that when the employees fax in their timesheets, the person doing the input would be helped in finding a possible duplicate entry.

            It's just one of those cases where, just when you thought you saw everything, something else pops up to test your abilities. My fallback position is to flag anything that has the same date during input.

            I'd be interested in any other ideas or approaches.

            Thanks!

            Comment


              #7
              Re: Checking Existing Time/Date

              I understand it is unreasonable to work these hours, but that was just one example. My questions were general ones to determine the simplest approach.
              If the work hours are day-time only, not around the clock, and
              If there is only one shift per day, and
              If an employee does not leave and return
              Then:
              The simplest approach is to match the employee with the date. Since only one shift could be worked per day, no need to bother with matching overlapping times.
              If otherwise, then you treat it like a calender to check for overlapping time and date.
              My questions were simple and general and yet to be answered.

              Comment


                #8
                Re: Checking Existing Time/Date

                Simplest is the Validation rule that EmployeeID and Date must Not Exist in a Table. Unless they work overnight as G has questioned and try to put it on one timesheet.
                This will force the input person to suspend processing. You might want to add a field showing acceptance or in dispute somewhere to list all disputed items.
                If the Validation fails, the inputter can find and change the original if approprite.
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                Apologies to anyone I haven't managed to upset yet.
                You are held in a queue and I will get to you soon.

                Comment


                  #9
                  Re: Checking Existing Time/Date

                  I know this is desktop side.
                  I have implemented this on my web where the sign in is by the employees. when they select a date and their name, as ted says, I look into the table and display what times they already signed in for and if not I say "you are not signed in". then they can proceed to sign in. reading the first post it appears that the time slips are given by the employees and the employer enters the data directly into a browse. in my approach the time slips are entered and added to the employee work table by the employees, since they already know what times they are signed in, this will prevent repeat entry. and you can add a comment field to add any comments by them why certain slips are different or duplicated.
                  then before the payroll on Monday I review a print out of the time grouped by employees and date. if there is any discrepancy I contact the employee and delete the appropriate record.
                  thanks for reading

                  gandhi

                  version 11 3381 - 4096
                  mysql backend
                  http://www.alphawebprogramming.blogspot.com
                  [email protected]
                  Skype:[email protected]
                  1 914 924 5171

                  Comment


                    #10
                    Re: Checking Existing Time/Date

                    Originally posted by Charles Hoens View Post
                    Thanks for the suggestions and ideas. I guess what I am looking for is how to lookup something which is being input within the table you are inputting to. I was thinking something along the lines of using the exist function within the field rules along with the between function.

                    I'd be interested in any other ideas or approaches.

                    Thanks!
                    Charles hello!
                    That is precisely what that code in post 3 will do.
                    When validating the input time range that code can open a second instance of the table you are using to look up - simply substitute tb=table.current() with table.open(...
                    reslt.records_get() >0 ' tells you immediately that there is and number of conflicting existing overlappaing record/s for that employee for that time range.
                    I find it soooo strange that you appear to choose to absolutely ignore a fully prepared solution then ask again for any other ideas.
                    Just ask if you want explicit alteration for your particular example - I've tested it, live, it works as you describe.
                    Last edited by Ray in Capetown; 04-19-2014, 08:44 AM.

                    Comment


                      #11
                      Re: Checking Existing Time/Date

                      I tested the same method I use in web on the desktop side using a form (not browse) for entry and it works just fine using onChange event of one of the fields ( second to enter of the two).
                      thanks for reading

                      gandhi

                      version 11 3381 - 4096
                      mysql backend
                      http://www.alphawebprogramming.blogspot.com
                      [email protected]
                      Skype:[email protected]
                      1 914 924 5171

                      Comment


                        #12
                        Re: Checking Existing Time/Date

                        It would be fairly simple - it would require a script at the cansave record event in the embedded browse
                        Cole Custom Programming - Terrell, Texas
                        972 524 8714
                        [email protected]

                        ____________________
                        "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

                        Comment


                          #13
                          Re: Checking Existing Time/Date

                          For goodness sakes.
                          Make the time entry into an xdialog.
                          Then have the checks of the data from the xdialog done against the table before anything gets saved and present whatever message needs to appear.
                          John Michaels
                          "The only thing needed for evil to flourish is for good men to do nothing" - great quote but probably not Sir Edmund Burke

                          Comment


                            #14
                            Re: Checking Existing Time/Date

                            For goodness sakes.
                            Make the time entry into an xdialog.
                            Then have the checks of the data from the xdialog done against the table before anything gets saved and present whatever message needs to appear.
                            Show us how you would do that please John. Others will be interested.
                            See our Hybrid Option here;
                            https://hybridapps.example-software.com/


                            Apologies to anyone I haven't managed to upset yet.
                            You are held in a queue and I will get to you soon.

                            Comment


                              #15
                              Re: Checking Existing Time/Date

                              Glad you mentioned show others Ted.
                              It appears that Charles is not really interested in suggestions nor of the help given or... ??
                              I have now used the snippet I devised (#3) in my own scheduling application so I'm ok Jack.

                              Comment

                              Working...
                              X