Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VAL() type of function?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00825781
Message ID:
00829034
Vues:
18
Fabio, this is close!! I get a 0 for any # ending in 0

SET @myCol = 'ALL-10'

SELECT CONVERT(INT,SUBSTRING(LEFT(@myCol,PATINDEX('%[1-9][A-Z]%',@myCol+'A')),PATINDEX('%-[0-9]%',@myCol)+1,15)) myValue

0

But this is close thanks!

__Stephen

>Hi Stephen,
>
>try
>
>DECLARE @myCol varchar(15)
>
>SET @myCol = 'FAB-767LUN'
>
>SELECT CONVERT(INT,SUBSTRING(LEFT(@myCol,PATINDEX('%[1-9][A-Z]%',@myCol+'A')),PATINDEX('%-[0-9]%',@myCol)+1,15)) myValue
>
>
>Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform