dbTalk Databases Forums  

Counting a list.

comp.databases.ms-access comp.databases.ms-access


Discuss Counting a list. in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tracy
 
Posts: n/a

Default Counting a list. - 06-27-2003 , 01:25 PM






I am trying to find a way to count a list from a table but not include
any duplicate entries that are found. (ie. same social security
number) Any help would be greatly appreciated. I am using Access 2000
if that matters.

Thank you in advance.

Reply With Quote
  #2  
Old   
PC Datasheet
 
Posts: n/a

Default Re: Counting a list. - 06-27-2003 , 01:53 PM






Create a query called MyQuery based on your table and only include the SS field.
Right click up in the window of the query (where you see your table) and click
on properties in the dialog that appears. In the query properties dialog that
appears, change unique values to Yes and close everything.

Put this expression in the control source of a textbox on the form where you
want the count:

=DCount("[NameOfSSFieldInMyQuery]","MyQuery")


--
PC Datasheet
A Resource for Access, Excel and Word Applications
resource (AT) pcdatasheet (DOT) com
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel



"Tracy" <qwerty017 (AT) yahoo (DOT) com> wrote

Quote:
I am trying to find a way to count a list from a table but not include
any duplicate entries that are found. (ie. same social security
number) Any help would be greatly appreciated. I am using Access 2000
if that matters.

Thank you in advance.



Reply With Quote
  #3  
Old   
David Merrick
 
Posts: n/a

Default Re: Counting a list. - 06-28-2003 , 01:39 AM



something like,

Select Count(1) From [Select Distinct Name, SocialSecurityNumber From People]. x

david



Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.