Showing posts with label characters. Show all posts
Showing posts with label characters. Show all posts

Thursday, March 29, 2012

Count of no. of characters

Hi,
Could anyone please let me know how many characters can we display in a single row in Crystal Report XI?
Thanks.It depends on the size of the page. Can you give us more informations on what you are trying to do

Sunday, March 25, 2012

count characters

I have a table with varchar values
What's the easiest way to find out how many comma's I have in the value?
Thanks
-------
TABLE 1:
col1
test,one,two,three
a,b,c,d,e,f,g
a
-------Hi

NoOfCommas = Len(MyCol) - Len(Replace(MyCol, ',',''))

HTH|||looks great!
thankssql

Thursday, March 22, 2012

Count "SPECIFIC" characters in a string

How do I count the number of specific characters in a string ?

Example:

declare @.var as varchar(50)
set @.var="1abc1efg1"

If I wanted to count the "1"...I'll get "3" for answer.
This could maybe done by using a while loop, but is there any T-SQL command for this???http://www.dbforums.com/t648578.html

select len(YourCol)-len(replace(YourCol,'1',''))