Solved

extract text at end of field

Posted on 2013-11-26
4
502 Views
Last Modified: 2014-08-05
How would I use the left + len + InStrRev functions to start at the end of the field and find "$bill" and then return that text pluss the remaining string?  I know how to use the right function to bring back the last few characters, but the issue is that the string after "$bill" varies. so I want to pull "$bill" and everything after that.  

It would also be nice to have it return something like "***" if the remaining string was longer than X characters (ie 10 characters), as a way to indicate that the "$bill" code was entered wrong....this would tell me that either the person entered too many characters after "$bill".  Alternate suggestions/approaches are welcome.

i.e. - the memo field would contain a string similar to below:

90 day EWP
five year, to be billed biennial. maturity date 11/13/18
1st 11/13/13
2nd 11/13/14
3rd 11/13/15
4th 11/13/16
5th 11/13/17
$bill52.2.1
0
Comment
Question by:IO_Dork
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39678986
Try this formula

Local StringVar strBill;

strBill := Mid({YourField},InStrRev({YourField},"$bill");
If Length(strBill) > 10 then
    strBill := "*****" & strBill;

strBill

Open in new window


mlmcc
0
 

Expert Comment

by:sj_porter
ID: 39678987
[Edited] I misread your question, so the answer I provided was slightly off.
0
 

Author Comment

by:IO_Dork
ID: 39679255
For record keeping...the mid() was missing the second ")" at the end....
Mid({YourField},InStrRev({YourField},"$bill"));


Local StringVar strBill;

strBill := Mid({YourField},InStrRev({YourField},"$bill");
If Length(strBill) > 10 then
    strBill := "*****" & strBill;

strBill
0
 

Author Closing Comment

by:IO_Dork
ID: 39679256
simple and direct solution. perfect!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question