Link to home
Start Free TrialLog in
Avatar of Ben Rapier
Ben Rapier

asked on

Extract substring from field in SQL

Using a SELECT query if possible, I need to "extract" a substring from within a field from a SQL db table. For example, I have a summary field in the 'Service' table [dbo.Service.summary] that contains a lot of unnecessary data but somewhere in all of that data is a substring that begins with 'INC' such as 'INC1256559'. How do I select only the substring (beginning with 'INC' and ending with the following space minus 1 [' ' -1]? Of course, I want to give the resulting column an alias like AS 'INC Number'


Full Example: T0554 Incident INC1256559 - DSL possible damaged cable run need tech to replace patch and phone cable
ASKER CERTIFIED SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial