October 6, 2016 at 2:52 pm
Hello,
I need to divide the fields into four parts. Right now, parsename command is working 95% of my data.
Example of the data are separated by the > sign.
1. Service > Systems > Solution > Vendor Management
2. Insurance > Business > Performance > Version 3.0
SQL command to obtain the last part:
PARSENAME(REPLACE(field1, ' > ', '.'), 1)
When running the query with the select statement, I got the 'Vendor Management' on the first one and the NULL value on the second result.
I believe it is due to the value has a 'dot' in there.
I tried to search for solutions from this page and I still cannot get it to work.
Anyone has suggestions? Thanks.
October 6, 2016 at 3:23 pm
Simply replace the periods with something else before replacing the greater than sign with a period. It's up to you whether you restore the periods after the PARSENAME.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
October 6, 2016 at 8:59 pm
Or use a real splitter.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply