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

Count characters

Status
Not open for further replies.

emikoo

Technical User
Jul 12, 2002
37
0
0
NL
Hi,

I have a table containing a memo field (1440 char. long). The memo field contains a sequence of characters, and I would like to do a count on each character. ie:

table:
Name_id String
John AABBCBCACBVB

to be converted in:
John A 3
John B 5 etc.

-OR-
Name_id A B
John 3 5

If got on this forum a vba script that parses the string in 1440 individual records. This however does take a lot of time to run (over a million records for one weeks data). Any suggestions to create the above listed result?

Thnxs,

EK



 
You could do it in a query.
Copy this function into a module in your database, then create a new query:

SELECT Name_ID,CountChar([String],"A") AS A,CountChar([String],"B") AS B,CountChar([String],"C") AS C...

will give you

Name_id A B
John 3 5


HTH

Ben ----------------------------------------
Ben O'Hara
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top