Solved

Manipulating string data in Crystal reports

Posted on 2013-02-07
3
505 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
[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
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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. …
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 this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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