Characters Total qry for fields

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

Guest

I have a table in an access databasse that has three fields. Is there a qry
that can count the number of characters within a field? Thanks.
 
Try:

SELECT MyField, Len(MyField) AS NumChars
FROM tblMyTable;

.. . . where MyField is the name of the field, NumChars is the number of
characters in that field, and tblMyTable is the name of the table.

If you use the QBE, then in the "Field" cell in the grid, try:

NumChars: Len(MyField)

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
CP said:
I have a table in an access databasse that has three fields. Is
there a qry that can count the number of characters within a field?
Thanks.

I'm assuming you are talking about text fields and if so
Len(Trim([Fieldname])) should return the number of characters. Now keep in
mind for a line like ABC DEF will return 7 due to the space being counted as
a character in this case. As for doing it in a query here is an example:

SELECT TENANTLetters.Note, Len(Trim([Note])) AS CharCount
FROM TENANTLetters;

This is only 1 field in a table but it could easily be more.
 
Back
Top