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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

dups in a query



 
 
Thread Tools Display Modes
  #1  
Old March 3rd, 2006, 03:03 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default dups in a query

I ran across this solution when looking for ways to eliminate dups in a query
I'm creating...The SELECT DISTINCT option seems like the answer for me, but
I'm not familiar with code in Access...can someone simplify this for me and
tell me where in the SQL view I should enter this text? Thanks so much!



I feel so stupid - I forgot about DISTINCT...
Thanks

"Marshall Barton" wrote:


Dan @BCBS wrote:

Can I add a simple statement to a query to eliminate duplicates, without
having to create a new query without making a new "Find Duplicates Query".
example: Criteria = "no dups"


No such criteria, but maybe

SELECT DISTINCT . . .

will do what you want?

--
Marsh
MVP [MS Access]


  #2  
Old March 3rd, 2006, 05:01 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default dups in a query

Open up the query in design view. Go to View then SQL View. Place the word
DISTINCT right after SELECT.

Another option is to open up the query in design view. Go to View then
Totals. By default Access will Group By all fields which is all but the same
as adding the DISTINCT.

Personally I like adding the DISTINCT better. Makes for cleaner looking SQL.
However you don't see the DISTINCT in the QBE grid so Totals has an advantage
when trying to find out why there aren't as many records as you think.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"bejewell" wrote:

I ran across this solution when looking for ways to eliminate dups in a query
I'm creating...The SELECT DISTINCT option seems like the answer for me, but
I'm not familiar with code in Access...can someone simplify this for me and
tell me where in the SQL view I should enter this text? Thanks so much!



I feel so stupid - I forgot about DISTINCT...
Thanks

"Marshall Barton" wrote:


Dan @BCBS wrote:

Can I add a simple statement to a query to eliminate duplicates, without
having to create a new query without making a new "Find Duplicates Query".
example: Criteria = "no dups"


No such criteria, but maybe

SELECT DISTINCT . . .

will do what you want?

--
Marsh
MVP [MS Access]


  #3  
Old March 3rd, 2006, 05:16 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default dups in a query

Thank you so much!!

"Jerry Whittle" wrote:

Open up the query in design view. Go to View then SQL View. Place the word
DISTINCT right after SELECT.

Another option is to open up the query in design view. Go to View then
Totals. By default Access will Group By all fields which is all but the same
as adding the DISTINCT.

Personally I like adding the DISTINCT better. Makes for cleaner looking SQL.
However you don't see the DISTINCT in the QBE grid so Totals has an advantage
when trying to find out why there aren't as many records as you think.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"bejewell" wrote:

I ran across this solution when looking for ways to eliminate dups in a query
I'm creating...The SELECT DISTINCT option seems like the answer for me, but
I'm not familiar with code in Access...can someone simplify this for me and
tell me where in the SQL view I should enter this text? Thanks so much!



I feel so stupid - I forgot about DISTINCT...
Thanks

"Marshall Barton" wrote:


Dan @BCBS wrote:

Can I add a simple statement to a query to eliminate duplicates, without
having to create a new query without making a new "Find Duplicates Query".
example: Criteria = "no dups"


No such criteria, but maybe

SELECT DISTINCT . . .

will do what you want?

--
Marsh
MVP [MS Access]


  #4  
Old March 3rd, 2006, 08:58 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default dups in a query

On Fri, 3 Mar 2006 09:01:34 -0800, Jerry Whittle
wrote:

Open up the query in design view. Go to View then SQL View. Place the word
DISTINCT right after SELECT.


or, equivalently, view the Query's Properties and set the "Unique
Values" property to Yes.

John W. Vinson[MVP]
 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Toolbars, Drop-Down Menus Rick New Users 1 September 21st, 2005 11:17 AM
SQL query showing diff between actual and budget Bon Running & Setting Up Queries 3 August 25th, 2005 12:07 PM
Nested in-line Query laura Running & Setting Up Queries 0 February 11th, 2005 12:17 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Too Few Parameters error Mail Merge Access Parameter Query Tony_VBACoder Mailmerge 3 September 14th, 2004 12:15 PM


All times are GMT +1. The time now is 11:07 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.