Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

derived column Expand / Collapse
Author
Message
Posted Monday, October 29, 2012 10:15 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 21, 2013 12:01 PM
Points: 149, Visits: 346
hi,


this is my derived column expression , SUBSTRING([Column 0],FINDSTRING([Column 0],"PAT",1),FINDSTRING([Column 0],"~",1))

for below line

TH*4.2*857463*01**20091015*1045*P**~~IS*7564* PHARMACY~PHA*1234567890~PAT*MA*06*987544****SMITH*JOHN****1234 MAIN ST**SOMEWHERE*MA*54356**19500101*M*01*01*INDIA**BURGER~


my result shoudl should be " PAT*MA*06*987544****SMITH*JOHN****1234 MAIN ST**SOMEWHERE*MA*54356**19500101*M*01*01*INDIA**BURGER"


but i am getting only " PAT*MA*06*987544****SMITH*JOHN****12"


whats reason?
Post #1378334
Posted Monday, October 29, 2012 10:28 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:58 PM
Points: 13,328, Visits: 12,826
Duplicate post. Direct replies here. http://www.sqlservercentral.com/Forums/Topic1378336-148-1.aspx

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1378340
Posted Monday, October 29, 2012 10:34 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, December 8, 2014 7:35 AM
Points: 888, Visits: 672
PLS try below code....
SUBSTRING([Column 0],FINDSTRING([Column 0],"PAT",1),FINDSTRING(SUBSTRING(FINDSTRING([Column 0],"PAT",1),LEN([Column 0])),"~",1))
Post #1378565
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse