Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Total count of unique records.

Status
Not open for further replies.

adamdunko

Technical User
Apr 18, 2003
10
US
I have a query pulling out all records of a specific type:

Docname, Docversion, Doctype
are the fields for example...

Doctype is the same for all results of the query.
Docversion is unique for all results of the query.
Docname is not unique for all results of the query.

What I am trying to do, is get a count of how many unique Docname's there are to put on a report drawn fromt his query. For example, if I use =count(), it will give me a total count of all records, and I just want to know how many Docname's there are in the query's resutls.

Can anyone help with this?
 
try something like

select distinct count(docname) from wherever;



Looking for a job as a programmer in Bristol UK.
 
ooops...


select count(distinct docname) from wherever;

thats what i meant to type....



Looking for a job as a programmer in Bristol UK.
 
I am not looking to see how many of a particular Docname there are, just how many different Docname's have resulted from the query.
 
Could you please post your actual SQL code ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top