Solved

Access Select query producing duplicate records

Posted on 2013-05-29
8
358 Views
Last Modified: 2013-10-15
running access 2k10, query which is producing multiple duplicate records in the result. Not on all records, just some. I've checked all related tables and there are no duplicates. I've added "Distinct" to the query but no change.

I've attached an rtf doc with the access query and the sql view. Any help greatly appreciated.
Document.rtf
0
Comment
Question by:jsgould
8 Comments
 
LVL 4

Assisted Solution

by:urthrilled
urthrilled earned 167 total points
Comment Utility
Try linking the Job table to the Tasks table by Job_No, instead of from JobRS to Tasks.
0
 

Author Comment

by:jsgould
Comment Utility
No difference, linking as . I believe it has something to do with Tasks. If I remove them from the query completely, I don't get the dups
0
 
LVL 92

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 167 total points
Comment Utility
I've added "Distinct" to the query but no change.

Please indicate what you mean by "producing multiple duplicate records in the result", because DISTINCT will never give you duplicates.  It is impossible for this to happen.
0
 

Author Comment

by:jsgould
Comment Utility
if u look at the sql in the attachment above, I inserted distinct after SELECT in the vba sql statement.

For a few entries, not all, i will get 2 to 4 exact duplicate records for a given acronym.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 92

Expert Comment

by:Patrick Matthews
Comment Utility
jsgould, I am sorry to be a pain here, but that is simply not possible.  There has to be some difference in the records.
0
 
LVL 48

Assisted Solution

by:PortletPaul
PortletPaul earned 166 total points
Comment Utility
it is my belief that some believe 'distinct' holds a magic quality and that it will intuitively know that the user wants only "one of something" and the other parts of a row "will just happen" (i.e. the magic occurs here).

select distinct -- is not magic
all, columns, will, be, evaluated, and, this, row, is, different, to, the, next, one, by, any, change
from real_world

the message is: "select distinct" works across everything in the row, the whole shooting match, the full enchilada, etc. Just the tiniest difference in any value will make a row "distinctive" from all other rows.

"multiple duplicate records" means you want something that select distinct cannot provide.

please provide your query, some results of it, and an explanation of what you consider is being duplicated. The solution almost certainly will not be "select distinct" by the way.

apologies in advance for the flippancy above - just trying to make a point through some humor
0
 

Accepted Solution

by:
jsgould earned 0 total points
Comment Utility
viola! discovered that task file has duplicate records. Thanks for all ur assistance
0
 

Author Closing Comment

by:jsgould
Comment Utility
I solved it by determining it to be a non-problem
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now