Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VAL() type of function?
Message
 
To
04/09/2003 09:59:02
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00825781
Message ID:
00829034
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform