Extract data from a field using a delimiter character

B

bdmsfan

I have a column with the following values
SCL (LP Steam Condensate)
WF (Fire Water)
P (Process Piping)
etc...

I need to extract only the characters inside the parenthesis (i.e.LP Steam
Condensate or Fire Water or Process Piping). I thought using the Left
Function but since the length is variable I am not sure how to set it so it
uses the parenthesis as delimiter. Thanks in advance.
Bruno
 
G

geebee

hi,

Try...

SELECT
Right(Left([column_name],InStr([part],")")-1),InStr([column_name],")")-2) AS
new_column_name
FROM tbl_name;

Hope this helps!

geebee
 
B

bdmsfan

Thanks geebee. It worked like a charm

geebee said:
hi,

Try...

SELECT
Right(Left([column_name],InStr([part],")")-1),InStr([column_name],")")-2) AS
new_column_name
FROM tbl_name;

Hope this helps!

geebee

bdmsfan said:
I have a column with the following values

etc...

I need to extract only the characters inside the parenthesis (i.e.LP Steam
Condensate or Fire Water or Process Piping). I thought using the Left
Function but since the length is variable I am not sure how to set it so it
uses the parenthesis as delimiter. Thanks in advance.
Bruno
 
Top