Results 1 to 6 of 6
  1. #1
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Cool Append Query

    dear all,
    i am using append query to insert record from first table to second table

    query as below


    INSERT INTO tblOFF ( ID, OFFdate, OFF )
    SELECT EmpClocking.ID, Format(EmpClocking.CIN,"dd-mmm-yy") AS OFFDATE, EmpClocking.OFFTYPE
    FROM EmpClocking
    WHERE (((EmpClocking.OFFTYPE)="OFF"));
    in empclocking one id number has more then one record
    but this query insert only one record which is first record
    later record it is not inserting what should i do?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    And the other record(s) meet the criteria? Could it be hitting any key violations? That should append all that meet the criteria, presuming no key violations, so if you're saying it doesn't, can you post a sample db that fails to?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Cool

    yes thanks.

    it was key violation

    now i am facing null or empty cells

    SELECT EmpClocking.ID, EmpClocking.CIN, EmpClocking.cout, EmpClocking.SHIFTCODE
    FROM EmpClocking
    WHERE (((EmpClocking.OtherType)=IsNull([EmpClocking]![OtherType])));

    i know there are empty cells in othertype column but nothing is appearing in query result

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Try

    WHERE [EmpClocking]![OtherType] Is Null
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Smile

    THANKS

    its working fine.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  2. append query
    By kroenc17 in forum Queries
    Replies: 8
    Last Post: 11-30-2010, 10:09 AM
  3. append query
    By w_kenny in forum Access
    Replies: 2
    Last Post: 08-24-2010, 05:48 AM
  4. Append Query (Maybe VBA?)
    By justinwright in forum Queries
    Replies: 14
    Last Post: 07-21-2010, 10:31 AM
  5. Append query won't append
    By yelkenli in forum Queries
    Replies: 5
    Last Post: 02-12-2010, 11:19 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