Apr 8, 2009 #1 mart10 MIS Nov 2, 2007 394 GB I am using CR XI I have a string containing OQxxxx,NQxxxx or NQxxxxx Note the xxx can be of variable length I want to just extract just the part NQxxxxx or even better the xxxx part of the NQxxxxx bit at the end.
I am using CR XI I have a string containing OQxxxx,NQxxxx or NQxxxxx Note the xxx can be of variable length I want to just extract just the part NQxxxxx or even better the xxxx part of the NQxxxxx bit at the end.
Apr 8, 2009 #2 IanWaterman Programmer Jun 26, 2002 3,511 GB If you use split('OQxxxx,NQxxxx or NQxxxxx', 'NQ')[3] This returns xxxxx If you replace above string with your filed you should get what you want. Ian Upvote 0 Downvote
If you use split('OQxxxx,NQxxxx or NQxxxxx', 'NQ')[3] This returns xxxxx If you replace above string with your filed you should get what you want. Ian
Apr 8, 2009 #3 dgillz Instructor Mar 2, 2001 10,054 US I think the OP means the value like one of these 3 strings: "OQxxxx" "NQxxxx "NQxxxxx" If so ant you want everything after the first 2 characters, use this: Mid({yourfield},3) If you want the 4 right characters, use this: right({yourfield},4) If you want the first 4 XXXX after the first 2 characters, use this: mid({yourfield},3,4) Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools: http://www.gainfocus.biz/exceladdin.html Upvote 0 Downvote
I think the OP means the value like one of these 3 strings: "OQxxxx" "NQxxxx "NQxxxxx" If so ant you want everything after the first 2 characters, use this: Mid({yourfield},3) If you want the 4 right characters, use this: right({yourfield},4) If you want the first 4 XXXX after the first 2 characters, use this: mid({yourfield},3,4) Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools: http://www.gainfocus.biz/exceladdin.html
Apr 9, 2009 #4 CR85user Technical User Jan 18, 2005 522 GB If it is always 'NQ' then Try the following: Code: strreverse(extractstring(strreverse({@string}),'','QN')) This would only work when the NQ is the last entry in the string but will suffice for any length. 'J CR8.5 / CRXI - Discovering the impossible Upvote 0 Downvote
If it is always 'NQ' then Try the following: Code: strreverse(extractstring(strreverse({@string}),'','QN')) This would only work when the NQ is the last entry in the string but will suffice for any length. 'J CR8.5 / CRXI - Discovering the impossible