Results 1 to 3 of 3
  1. #1
    Canadiangal is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    81

    Append Query selecting an number going into an autonumber field Data Type Mismatch in

    I am using an append query. I am getting a data type mismatch in criteria expression. Hard to understand how, since I copied the table? I have field to field matched. SQL reads

    INSERT INTO [Copy Of Employees] ( SocialSecurityNumber, FirstName, LastName, EmployeeID, Address, City, State, PostalCode, HomePhone, CellPhone, Birthdate )


    SELECT Employees.SocialSecurityNumber, Employees.FirstName, Employees.LastName, Employees.EmployeeID, Employees.Address, Employees.City, Employees.State, Employees.PostalCode, Employees.HomePhone, Employees.CellPhone, Employees.Birthdate
    FROM Employees;


    I did a little test and ran the append query, with the EmployeeID and that did not have any data type mismatch. So I am assuming the error is generated because EmployeeID is a number in the Employee table and a autonumber in the Copy Of Employee table. I deleted the table out and copied the structure again. This time I made sure that no field was set to be the primary key. Still the same error message. Any work arounds?

  2. #2
    Canadiangal is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Posts
    81
    Deleted it all out again and it worked. No idea why.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Thanks for following up. Certainly looks like it should have worked.
    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. Data Type Mismatch in SQL
    By Phred in forum Queries
    Replies: 2
    Last Post: 01-04-2012, 03:40 PM
  2. Data type mismatch in query criteria
    By TinaCa in forum Queries
    Replies: 2
    Last Post: 09-19-2011, 11:31 PM
  3. Data Type Mismatch
    By timmy in forum Programming
    Replies: 9
    Last Post: 04-12-2011, 03:48 AM
  4. Data type mismatch in query
    By thart21 in forum Queries
    Replies: 8
    Last Post: 10-01-2010, 01:40 PM
  5. query for data type number
    By oracle in forum Queries
    Replies: 1
    Last Post: 12-14-2005, 03:35 PM

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