Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Need both Alpha and Numeric info from a field Post Reply Post New Topic
<< Prev Page  of 2
Author Message
cheryla
Groupie
Groupie


Joined: 23 Oct 2013
Online Status: Offline
Posts: 51
Quote cheryla Replybullet Posted: 04 Oct 2017 at 2:48am
I wondered if you were able to look into to this further. Please advise.

THanks again!!

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 04 Oct 2017 at 3:58am
This should work.  Replace str with your field.

numbervar i;
stringvar result;

for i := 1 to len(str) do
 (if isnumeric(mid(str,i,1)) then
    result := result + mid(str,i,1)
 );
result;
IP IP Logged
cheryla
Groupie
Groupie


Joined: 23 Oct 2013
Online Status: Offline
Posts: 51
Quote cheryla Replybullet Posted: 06 Oct 2017 at 9:17am
Hi again. Thx so much for responding. However, something still isn't quite right.

I entered in the formula as basic syntax and it's telling me "a statement is expected here" for numbervar

When I tried it as crystal syntax it is taking the very first part # and repeating it:

my first few part #'s are:

10993
11273
11399
11399B
EQI#10831-03

The result I am getting for every line is:

1099310993109931099310993

should there be an end if or something to tell it to stop and the move to the next line?

I know we're close to solving it. I really do appreciate your time.

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 06 Oct 2017 at 10:50am
One, it is not basic syntax but  crystal syntax. (the := for assignment statements is a easy give away).

I am not sure where you are putting the formula (group header, detail, etc.).  You may need another formula to clear out result (group header?).  You may need to create another detail line above where you are displaying the result and put the clear formula there (you can suppress that detail line).

i.e., stringvar result := "";
IP IP Logged
<< Prev Page  of 2
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.