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

Count Number in a string

Status
Not open for further replies.

SuperTime

Programmer
Dec 21, 2004
183
US
Crystal 9, Sql database



I have a String field in the database

38870,38891,38894,38898,39037,39044,


I want read this field and count the numbers in the string . so i want to get the number 6 in the above example.

How can i do that in a formula
 
Hi,
If the string is always separated by commas, then create an array and check # of entries:
This should do it:
@howmany
Code:
UBound(Split({YOURSTRINGFIELD},','))





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Since the last number in your example has a comma after it, you'll need to subtract one.

UBound(Split({YOURSTRINGFIELD},','))-1

-k
 
Hi,
Nice catch, synapse - and on a Friday afternoon as well..I'm impressed....[thumbsup2]

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top