robert030975
MIS
- Oct 17, 2006
- 227
HI Guys
I'm struggling at the monment separting txt
WITH t(hours) AS (
Select '3WH' UNION ALL
Select '3WH ' UNION ALL
Select '4WH' UNION ALL
Select '3 WH' UNION ALL
Select '3 ' UNION ALL
Select '4' UNION ALL
Select '3 W' UNION ALL
Select 'WH3 ' UNION ALL
Select 'W 3' )
SELECT PATINDEX('%[0-9]%', hours + '0') FROM t
you can see in the results there is a lot of 1's ideally what I would like to see is (col 1 3, col 2 WH)
any help would be great thanx
I'm struggling at the monment separting txt
WITH t(hours) AS (
Select '3WH' UNION ALL
Select '3WH ' UNION ALL
Select '4WH' UNION ALL
Select '3 WH' UNION ALL
Select '3 ' UNION ALL
Select '4' UNION ALL
Select '3 W' UNION ALL
Select 'WH3 ' UNION ALL
Select 'W 3' )
SELECT PATINDEX('%[0-9]%', hours + '0') FROM t
you can see in the results there is a lot of 1's ideally what I would like to see is (col 1 3, col 2 WH)
any help would be great thanx