Solved

Manipulating string data in Crystal reports

Posted on 2013-02-07
3
494 Views
Last Modified: 2013-02-07
Hello all,

I need some help with a Crystal formula on a string.

I have a string of data I want to manipulate. In Crystal that looks like this:
"ACCT_NBR=123456|iD_NUM=123456"

i want to just pull out the acct_nbr field.  It will always start after the equals sign at the 12th character.  The field length could be 4 to 6 characters then ends with the pipe.

What is the correct function to just pull out the acct_nbr?  I was messing around with a few but could not get it quite right.
0
Comment
Question by:mike-9
  • 2
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 38864372
"start after the equals sign at the 12th character."

On my screen the first number occurs at position 10, not 12.

So i would expect to use a formula field like...

numbervar s;
numbervar f;
s:=10;
f:=instr({table.field}, "|");
mid({table.field}, s, f-s)
0
 

Author Comment

by:mike-9
ID: 38864434
You are right about the 10th position in the above post.  I left out a few unneeded characters from data I was working with for simplification.  

Thanks for the tip. That definitely did what was needed.  

I think I found another way to do the same thing from browsing around the site.  

tonumber(Mid(Split({table.field},"|")[1],12))

Thanks again for the quick response!
0
 

Author Closing Comment

by:mike-9
ID: 38864440
Exactly what I was looking for.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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