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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum or Duplicate records in a recordset.

Status
Not open for further replies.

TheUltimateChampion

Programmer
Dec 28, 2004
2
US
How do I count the number of times a field has duplicate data in a Record in a Table? Example:
Rows 1,2, & 3 have a Field Heading of Silverwear. In Rows 1, 2 I have "Fork". In row 3, Knife.
I would like a (in a Module) to return 2 for a Fork query.

I would also like to do this in a query (but one thing at a time).

Thank you.
 
Something like this ?
SELECT Silverwear, Count(*) AS DupCount
FROM yourTable
GROUP BY Silverwear

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That is SQL isn't it?
I was hoping for VBA. Something like Count Me.Recordset...

Thank you.
 
Are you aware you posted in the ANSI_SQL forum ?
Anyway take a look at the DCount VBA function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top