Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Char occurence in a string
Message
De
29/01/2003 15:05:59
 
 
À
29/01/2003 14:45:54
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00746848
Message ID:
00746855
Vues:
18
This message has been marked as the solution to the initial question of the thread.
There's a slick little trick:

LEN(REPLACE(string, '-', '--')) - LEN(string)

-Mike

>Hi,
>
>I would like to find out how many times the
>- appears in a string....
>
>Is there an efficient way to find this out.
>
>Therefore,
>
>my string could be.
>
>C-X-AB1515-02-01
>
>
>I want to find out the number of times the - appears in the string.
>
>Thanks,
>
>a
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform