Solved

Manipulating string data in Crystal reports

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now