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

search for string in table and return count

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I need help!! I have a table in which im trying to find the count of a string in a specific column. In other words, im trying to count how many times "mike" shows up in a specific column.Can anyone help!!
 
The easiest way to do this is with the DCount function.

Dim numRecs As Integer

numRecs = DCount(fieldname, tablename, fieldname = "mike") dz
dzaccess@yahoo.com
 
thanks for the response. But i actually I am trying to get a substring. The field is one long string ie" xxx|xxx|xxx".
 
Ah, sorry I misunderstood your question. Do you want to do this for a specific record in the table or for all records? In other words, do you want to count the number of occurrences in each record and sum them together, or find a record and count the number of occurrences in that one record? dz
dzaccess@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top