A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Queries without duplicates



 
 
Thread Tools Display Modes
  #1  
Old June 30th, 2008, 04:45 PM posted to microsoft.public.access.queries
puppypaws
external usenet poster
 
Posts: 5
Default Queries without duplicates

I'm working with a huge imported database from which I needa query with
employee id, last name, first name, benefit name employee cost and employer
cost. I keep getting duplicates on the ID and names. How can I get rid of
these so that the employee number is the key record?
  #2  
Old June 30th, 2008, 04:54 PM posted to microsoft.public.access.queries
scubadiver
external usenet poster
 
Posts: 1,673
Default Queries without duplicates


Why not use distinct?

Select distinct ......
from ....

"puppypaws" wrote:

I'm working with a huge imported database from which I needa query with
employee id, last name, first name, benefit name employee cost and employer
cost. I keep getting duplicates on the ID and names. How can I get rid of
these so that the employee number is the key record?

  #3  
Old June 30th, 2008, 04:54 PM posted to microsoft.public.access.queries
[email protected]
external usenet poster
 
Posts: 25
Default Queries without duplicates

setup an empty table with the employee ID set as primary key. then
change your query into an append query and append into that table.
you will get a warning saying "cant append X number of records due to
primary key violation". those are your dupes not being entered. the
table will then have your records with no duplicates.
  #4  
Old June 30th, 2008, 04:59 PM posted to microsoft.public.access.queries
puppypaws
external usenet poster
 
Posts: 5
Default Queries without duplicates

I'm not very experienced with this. I've tried "first" and " no duplicates"
but it takes away everything. Do I just type "distinct" in the criteria box?

"scubadiver" wrote:


Why not use distinct?

Select distinct ......
from ....

"puppypaws" wrote:

I'm working with a huge imported database from which I needa query with
employee id, last name, first name, benefit name employee cost and employer
cost. I keep getting duplicates on the ID and names. How can I get rid of
these so that the employee number is the key record?

  #5  
Old June 30th, 2008, 05:02 PM posted to microsoft.public.access.queries
puppypaws
external usenet poster
 
Posts: 5
Default Queries without duplicates

Thanks! I'll give it a try!

" wrote:

setup an empty table with the employee ID set as primary key. then
change your query into an append query and append into that table.
you will get a warning saying "cant append X number of records due to
primary key violation". those are your dupes not being entered. the
table will then have your records with no duplicates.

  #6  
Old July 1st, 2008, 05:12 AM posted to microsoft.public.access.queries
Christopher Robin
external usenet poster
 
Posts: 42
Default Queries without duplicates

Please, do not duplicate your data.

As a previous poster suggested (but left the details out), use a SELECT
DISTINCT. From the Query window, select the SQL View, and type a SQL
Statement like:

SELECT DISTINCT Col1, Col2, Col3.....
FROM myTable

Or from the GUI, add the columns to your query and then select the Totals
button. Just ensure that each column has a Group By in the Totals row (this
is the default).

"puppypaws" wrote:

Thanks! I'll give it a try!

" wrote:

setup an empty table with the employee ID set as primary key. then
change your query into an append query and append into that table.
you will get a warning saying "cant append X number of records due to
primary key violation". those are your dupes not being entered. the
table will then have your records with no duplicates.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.