Results 1 to 7 of 7
  1. #1
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215

    query returning extra items


    Hi,

    I am fairly new to Access and am trying to design a query that returns certain information from 2 tables that have a common relationship. The problem that I am running into is that the query, when ran, returns more results than the original table has. I can't figure out why or how to fix it. Any ideas?

  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,652
    What's the SQL of the query? It sounds like you've neglected to join the 2 tables on the common field(s). That will produce a Cartesian product.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215
    SELECT [Client Accounts].[Last Name], [Client Accounts].[First Name], [Client Accounts].[Middle Initial], [Client Accounts].Suffix, [Client Accounts].Address, [Client Accounts].City, [Client Accounts].State, [Client Accounts].[Zip Code], [Client Accounts].Email, [Registered Representatives].[Last Name], [Registered Representatives].[First Name]
    FROM [Registered Representatives] INNER JOIN [Client Accounts] ON [Registered Representatives].[Rep Number] = [Client Accounts].[Rep Name].Value
    ORDER BY [Client Accounts].[Last Name], [Client Accounts].[First Name];

  4. #4
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215
    I just did it all in the Design View not through the SQL View

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    That should return all records that have the rep field in common. Can you post the db if it's still not doing what you expect?

    FYI, design view is just a user friendly interface to SQL view. Internally, Access uses the SQL.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215
    Thanks. I figured out why it was doing that. It was an oversight on my part.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    No problem, glad you got it sorted out.
    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. Query - Returning ID instead of Value...??
    By Poolio in forum Queries
    Replies: 5
    Last Post: 04-18-2011, 07:10 AM
  2. Returning inverse of a query
    By caddcop in forum Queries
    Replies: 5
    Last Post: 02-16-2011, 04:48 PM
  3. Query. Extra column.
    By seweryng in forum Queries
    Replies: 1
    Last Post: 01-14-2011, 08:59 AM
  4. Replies: 5
    Last Post: 12-03-2010, 01:39 PM
  5. Query not returning all of the results
    By velvettiger in forum Queries
    Replies: 4
    Last Post: 03-11-2010, 06:56 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