Results 1 to 2 of 2
  1. #1
    smith is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Apr 2011
    Posts
    5

    Update Query

    I have a form that is used for data entry into a table. The form has two fields on it, call them EmpNum, and Timenow.



    When the form gets data, from a barcode scanner, for example, the two fields are entered into a table. The employee number and the time his id number was read by the bar code scanner.

    But the table has an additional field on it, for designating whether a swipe was a "Clock in" or a "Clock out". I would like an update query to add these values to the table.

    Table has 4 fields - pk#, EmpNum, Timenow, Scantype

    If I could run a query and first group the records by EmpNum, then order the records returned by the query into EVEN or ODD numbers, then the ODD numbered records would be "Clock In" and the EVEN numbered records would be "Clock Out" records.

    Then I could use a regular query to calculate hours worked on a project for example.

    I tried creating an update query, but I am not successfully finding the right function or parameter to get what I want.

    Can anyone help?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,619
    Could try this criteria in WHERE clause (assumes no gaps in pk sequence):

    [pk#] Mod 2 = 0
    or
    [pk#] Mod 2 <> 0

    BTW, special characters, spaces, punctuation (underscore is exception) in names is not advised. Better would be pkNum.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  2. Replies: 2
    Last Post: 09-21-2011, 01:30 PM
  3. Replies: 1
    Last Post: 08-19-2011, 12:16 PM
  4. Update 2 tables with one Update Query
    By Douglasrac in forum Queries
    Replies: 4
    Last Post: 04-14-2011, 08:33 AM
  5. Update Query- selective update?
    By stephenaa5 in forum Queries
    Replies: 1
    Last Post: 10-29-2009, 11:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums