Solved

parse out string field  in crystal

Posted on 2010-08-31
4
608 Views
Last Modified: 2012-06-21
I have a string field that holds city, state zip I need to parse out state for a crystal reprot
0
Comment
Question by:patsylipp
4 Comments
 
LVL 12

Accepted Solution

by:
JayConverse earned 250 total points
ID: 33572569
Press F1 and take a look at the Split() function.  Assuming consistent formatting of the data, i.e.,

city{COMMA}{SPACE}state{space}zip

You would split once on ", " and take the second array element

then split again on " " and take the first array element

0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 250 total points
ID: 33572980
Or if you just need the state always
This assumes you always have a city and state

Split({YourField}," ")[2]

mlmcc
0
 
LVL 34

Expert Comment

by:James0628
ID: 33574109
mlmcc,

 That won't work so well with city names that are 2 or more words.  But, then again, what are the odds of that happening?  ;-)

 James
0
 
LVL 19

Expert Comment

by:GJParker
ID: 33574598
It woudl be far simpler to help you if you at least provided a sample of your data format rather than having to guess.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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…
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…

820 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