Avatar of steven
steven
Flag for United States of America asked on

Rip data from string

Can anyone help me to rip data from a string?  I have not been able to get it correct as it is not always the same one example  "4 X "5.02 X "5.32    another may be 2.5" X .75"  X 3" .
Microsoft SQL Server

Avatar of undefined
Last Comment
Pawan Kumar

8/22/2022 - Mon
Pawan Kumar

What output you need from your input.
Vitor Montalvão

Are those mathematics expressions?
steven

ASKER
Sorry not mathematics, just a measurement. I need the numbers only
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Pawan Kumar

"4 X "5.02 X "5.32  -------> 45.025.32 ??
steven

ASKER
No just              4  
                          5.02
                          5.32
Pawan Kumar

3 rows ?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
steven

ASKER
One row would fine with each value
Pawan Kumar

Do you have a table where these values are stored?
steven

ASKER
Yes columns od, id, length
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
Pawan Kumar

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
steven

ASKER
Id gives me the below error,

Msg 537, Level 16, State 3, Line 2
Invalid length parameter passed to the LEFT or SUBSTRING function.


the OD and Length are correct!!  Excellent  We are running sql 2012 r2
Pawan Kumar

How many rows are there in your table? can you send you data to me in an excel?
steven

ASKER
There are many but I only pulled the top 100 and got the error.
test.xlsx
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
steven

ASKER
Blew out on  2" DIA. X 6"  the 60th row...
Pawan Kumar

What should be the output for above.
steven

ASKER
I got it used a case to find DIA and use null
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
steven

ASKER
Thank you Pawan.  I was able to use this just fine!  excellent job
Pawan Kumar

Welcome. Happy to help as always. :)