I have a column in a table (named 'docksTemp) that has dimensional data in it, like this 12x18
I need it seperated into two columns and drop the 'x'
initial column name is Dimensions, I want that parsed out to DimensionWidth and DimensionLength
I use these two commands:
SET DimensionWidth = LEFT(Dimensions,CHARINDEX('x',Dimensions)-1)
SET DimensionLength = RIGHT(Dimensions,LEN(Dimensions)-CHARINDEX('x',Dimensions))
The length portion of it works, it seperates the data no problem. the first part with the width doesn't work I get a
ERROR: Invalid length parameter passed to the LEFT or SUBSTRING
function. Error Code: 537
If I use the same command but add a where clause and just do one statement at a time that create the correct results. So what I think is its having problems when there might be a field with no data in it? I can I get it deal with that?