Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access Select query producing duplicate records

Posted on 2013-05-29
8
Medium Priority
?
420 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 4

Assisted Solution

by:urthrilled
urthrilled earned 501 total points
ID: 39205213
Try linking the Job table to the Tasks table by Job_No, instead of from JobRS to Tasks.
0
 

Author Comment

by:jsgould
ID: 39205583
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 93

Assisted Solution

by:Patrick Matthews
Patrick Matthews earned 501 total points
ID: 39206484
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:jsgould
ID: 39206501
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
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 39206518
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 49

Assisted Solution

by:PortletPaul
PortletPaul earned 498 total points
ID: 39206855
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
ID: 39208974
viola! discovered that task file has duplicate records. Thanks for all ur assistance
0
 

Author Closing Comment

by:jsgould
ID: 39573141
I solved it by determining it to be a non-problem
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

604 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