Results 1 to 5 of 5
  1. #1
    sgray is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    7

    specified field could refer to more than one table

    I have a query that uses two tables linked via a field called OrderNumber and it says the specified field [ordernumber] could refer to more than one table. This is what i have:

    SELECT Items.Description, Items.Customer,Orders.OrderNumber,Items.PartNumber ,Items.InvoiceNumber,Orders.Supplier,Orders.DateOr dered,Orders.DateArrived


    FROM Orders INNER JOIN Items ON Orders.[OrderNumber] = Items.[OrderNumber]

    How do i fix this so it gets OrderNumber from the table Orders.

  2. #2
    Aragan is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    22
    can u explain better what do u want? my english is not perfect but i wanna help u

  3. #3
    sgray is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    7
    I had two tables that contained the same field name. I wanted to be able to run my query without having to change the name of one of the fields. I have ended up just changing one of the names but it would be good to know if this can still be done.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Quote Originally Posted by sgray View Post
    I have a query that uses two tables linked via a field called OrderNumber and it says the specified field [ordernumber] could refer to more than one table. This is what i have:

    SELECT Items.Description, Items.Customer,Orders.OrderNumber,Items.PartNumber ,Items.InvoiceNumber,Orders.Supplier,Orders.DateOr dered,Orders.DateArrived
    FROM Orders INNER JOIN Items ON Orders.[OrderNumber] = Items.[OrderNumber]

    How do i fix this so it gets OrderNumber from the table Orders.
    Have you modified this sql since you got the error?
    The error would normally occur if Access could not identify a specific field. That's why there is typically a Table.field construct to uniquely identify fields within tables. However, if the fields in the tables are named differently that Table.field construct can often be reduced to just using field names.

    So, if you had all field references set up using Table.field, there should be no ambiguity, and no error.

  5. #5
    Aragan is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    22
    Quote Originally Posted by sgray View Post
    I had two tables that contained the same field name. I wanted to be able to run my query without having to change the name of one of the fields. I have ended up just changing one of the names but it would be good to know if this can still be done.
    ya...if u use the Table.Field syntax u can have the same field name in different tables without problems cuz the table name will mak the difference

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

Similar Threads

  1. Refer to ONLY THE MONTH??
    By taimysho0 in forum Programming
    Replies: 18
    Last Post: 01-27-2012, 01:12 PM
  2. Replies: 3
    Last Post: 09-08-2011, 04:40 PM
  3. Replies: 10
    Last Post: 08-08-2011, 01:55 PM
  4. Replies: 1
    Last Post: 04-15-2011, 01:43 PM
  5. Replies: 4
    Last Post: 03-12-2010, 05:42 PM

Tags for this Thread

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