emailamos
asked on
Striping out text within a double quote MS SQL
I'm trying to strip out text (+BAT_MATFXOPT+BAT_MATUPD) from one of the row MultiFilterNames:"+BAT_MAT FXOPT+BAT_ MATUPD" DelivMonth:(|TF_DTRNG| ()) FXValueDate:(|TF_DTRNG| ()) FilterAttributesXML:"<Filt erAttribut es></Filte rAttribute s>" ) within double quote right after MultiFilterNames:
Thanks
MultiFilterNames.xls
Thanks
MultiFilterNames.xls
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try the below:
just replace yourcol, with your actual column name.
just replace yourcol, with your actual column name.
select
stuff(
yourcol,
charindex(yourcol, '"'),
charindex(yourcol, '"', charindex(yourcol, '"') + 1),
''
)
from yourtable
or you can actually simplify it a bit considering that all rows start with "MultiFilterNames:"
select
stuff(
yourcol,
18,
charindex(yourcol, '"', 19),
''
)
from yourtable
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try this after u create the function
SELECT dbo.CustomFunc('MultiFilte rNames:"+B AT_MATFXOP T+BAT_MATU PD" DelivMonth:(|TF_DTRNG| ()) FXValueDate:(|TF_DTRNG| ()) FilterAttributesXML:"<Filt erAttribut es></Filte rAttribute s>" )')
SELECT dbo.CustomFunc('MultiFilte
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ralmada... u r correct.
ASKER