+ Reply to Thread
Results 1 to 4 of 4

Compare two rows of data

  1. #1
    Webtekr
    Guest

    Compare two rows of data

    Hi everybody,

    I have a database that shows when an employee clocks in and out for work. In my database each set of clock in and clock out is on individual rows. So for example if the employee clocks in at 9 and out at 5 the database displays it on the time in and out on one row. If, on the same day, the employee went to lunch from 12 to 12:30 it displays it on the next row as clock in at 12 and out at 12:30. Here obviously the lunch is considered a lunch shift where the employee is clocking in for lunch at 12 and out at 12:30.

    I have been able to calculate the hours in each shift (row). However, now I want to have only the days when an employee worked more than 5 hours in one day and where he/she did not have a lunch break.

    Any help would be GREATLY appreciated.

  2. #2
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: Compare two rows of data

    I'm assuming you have a field that describes the shift - work vs lunch.
    Create a query that does the summations you desire

    Create a column that evaluates the Shift type. You can use something like:
    Please Login or Register  to view this content.
    Set the Total type to Sum
    Set the criteria to 0


    I've attached a small sample db.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-13-2009
    Location
    CA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Compare two rows of data

    I need the same exact thing the poster needed. However, when I inputted new "work" shifts into the table that were less than 6 hours they still ended up on the query results. In other words, the sample database query does not filter out instances where an employee has a "work" shift that is shorter than 6 hours, but does not have a meal period. Under California law a meal period violation occurs when an employee works more than 6 hours long and does not get a 30 minute lunch break. So all the works shifts of 6 hours or less without a meal period would need to be filtered out because they do not constitute a lunch break violation under California law.

    I am assuming, of course, that the original poster was looking for the same thing. In any case, that is what I am looking for.
    Last edited by astrom33; 08-13-2009 at 07:01 PM.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Compare two rows of data

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then start your own thread.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1