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

Count a particular character in string.

Status
Not open for further replies.

tmunson99

MIS
Jun 18, 2004
62
US
Is there a SQL command that will count the number of times a particular character occurs in a string? For example, I have an Org string - 123.ABC.abc.def.ghi.jkl.mno or 123.ABC.abc.def. I have a stored procedure that parses each tuple. Without getting into the complexity of the stored procedure, is there a SQL query I can run against OrgId that will count the number of periods [.]?

So 123.ABC.abc.def.ghi.jkl.mno, will return 6
and 123.ABC.abc.def returns 3
 
Put a star :)


Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
MVP VFP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top