Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Part of a string after certain value 2

Status
Not open for further replies.

kpetree10

IS-IT--Management
Jun 15, 2007
57
US
Hi all, I'm working on creating a crystal report that needs to pull a piece of data from a long string, here's an example...

Code:
[Header]  PlanRelease=0  ReleaseNbr=20111021  [Main]  TS=DELFOR  HaveShipDate=TRUE  HorizonEnd=20141231  HorizonBegin=20080212  [Address]  SU=G0143  ST=OMITTED  MI=OMITTED  [Reference]  RE=16  [Item]  RC=GM5310  [Marks]  11Z=12K034 RACK 08  [Cum]  Date=20080212  Qty=0  [Date]  Check=TRUE  [Detail]  Bucket=FALSE  [Macola]  ShipDate=20111026  PONbr=OMITTED  [Document]  Prior=20111019

What I need to pull out of that is the value that follows '11Z='. Does anyone have any idea of how I could do that. I would use mid but sometimes the position changes so that won't work. Thanks in advance!
 
Hi,
Use both MID and InStr to parse it like:

Mid({Table.Field},InStr("11Z=")+5)

(Use 5 because InStr will return the postition of the 1 in the string, so skip over the 1Z= to return the balance of the string)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Tweak:

Mid({Table.Field},InStr("11Z=")+5,6)

-LB
 
Hi,
Thanks LB, I misread the issue as the OP wanting all the data that followed the specified string.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top