Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

extract text at end of field

Posted on 2013-11-26
4
Medium Priority
?
504 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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
On Sep 22nd 2014 Microsoft released Update Rollup 1 for Microsoft Dynamics CRM 2013 Service Pack 1 and back in July Update Rollup 3 was released.  So we now have:   Update Rollup 1Update Rollup 2Update Rollup 3Service Pack 1Update Rollup 1 for S…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

618 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