In gallons_column I sometimes encounter strings like ‘98.0,2.45,0.25’.I have been able to extract 98.0 and 0.25 but the middle string I am having difficulties. I have been trying substring to extract the middle string but I can’t work out the rest of the syntax.
Any help or suggestions will be appreciated. Thanks
I am using SSM 18. I used the code below to extract 98.0 and 0.25
volume_sold_liters=LEFT(volume_sold_gallons,CHARINDEX(',',volume_sold_gallons)-1),
volume_sold_gallons = RIGHT(volume_sold_gallons,CHARINDEX(',', (REVERSE(volume_sold_gallons)))-1)
FROM project
WHERE store_number =3621
```````
--As for the middle string I was trying to use the code below with no success.
`````````
SELECT volume_sold_liters = SubString(volume_sold_gallons,CHARINDEX(',',volume_sold_gallons)+1),
RIGHT(volume_sold_gallons,CHARINDEX(',', (REVERSE(volume_sold_gallons)))-1) FROM project