Count characters in a text field

H

Harold M

I am trying to count the number of characters in a text field.

For example, a credit card field may have 16 (Visa / MC), 15 (Amex), etc...
In some cases Visa may only have 13 characters. This does exclude any
hyphens.

Is there an easy way to do this?

Thank You
 
H

Harold M

That's a very helpful tip but it wasn't what I was looking for. I was
trying to find out how to count the number of characters in a field. If a
field has "4435443244563422" I could have a query expression that returns a
16 for the number of characters.


Duane Hookom said:
You can try Len(Replace([CardNum],"-",""))

--
Duane Hookom
MS Access MVP


Harold M said:
I am trying to count the number of characters in a text field.

For example, a credit card field may have 16 (Visa / MC), 15 (Amex), etc...
In some cases Visa may only have 13 characters. This does exclude any
hyphens.

Is there an easy way to do this?

Thank You
 
D

Duane Hookom

Did you try this? I did and the expression returned 16.

--
Duane Hookom
MS Access MVP


Harold M said:
That's a very helpful tip but it wasn't what I was looking for. I was
trying to find out how to count the number of characters in a field. If a
field has "4435443244563422" I could have a query expression that returns a
16 for the number of characters.


Duane Hookom said:
You can try Len(Replace([CardNum],"-",""))

--
Duane Hookom
MS Access MVP


Harold M said:
I am trying to count the number of characters in a text field.

For example, a credit card field may have 16 (Visa / MC), 15 (Amex), etc...
In some cases Visa may only have 13 characters. This does exclude any
hyphens.

Is there an easy way to do this?

Thank You
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top