I need help to accomplish the task of getting two values from the string in one column.
I need to extract the first set of characters as regardless of the length until the first forward slash (/) is found.
The second task I need to do is to get the value after the first forward slash until the second back slash is found. (Row IDs 1 and 2 meet this criteria)
For row number 3, there is a forward slash but, it is not in the whole value is not in the same format as the first two rows. In this case I need to ignore this row.
This is the values I need to see based on the sample date
357-1329 user one (row 1)
224-57 User Two (row 2)
This is the DDL
Drop table MyTestTable
CREATE TABLE [dbo].[MyTestTable](
[ID] int Not NULL,
[Col1] [varchar](100) NULL)
Insert into MyTestTable
Select 1, '357-1329 / user one / User One/357-1329' UNION ALL
Select 2, '224-57 / User Two / O0427A-85311 EG 8/24' UNION ALL
Select 3, '214-962 User Three PLUMBING SUPPLIES EG 8/30'
Thanks in advance