Count/Frequency of text within a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

To whom it may concern

Can you tell me how I can create an access query which
will look in a column and produce a count of how
frequently a piece of text or a number occurs within a
column of a Access table.

Thanks

Nick
 
Nick,

You don't need a query to do that, all you need is a DLookup function like:

DCount("*","MyTable", "[Field1] Like '*SearchString*'")

which will return the number of records in table MyTable where the test
"SearchString" is contained in field Field1.

HTH,
Nikos
 
If you want a list of occurances for a certain field then you can also use:

SELECT FieldName, Count(*)
FROM TableName
GROUP BY FieldName
ORDER BY Count(*) DESC

- Raoul
 
Back
Top