Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Extracting a Numeric Value from a String Post Reply Post New Topic
Author Message
jsh8286
Groupie
Groupie
Avatar

Joined: 09 Mar 2012
Online Status: Offline
Posts: 46
Quote jsh8286 Replybullet Topic: Extracting a Numeric Value from a String
     Posted: 09 Mar 2012 at 11:10am
Hi Guys,

Had a quick question with extracting data from a string in Crystal Reports. I have the following descriptions for some items:

WEATHERMAX 450L

WEATHERMAX 1150L

RT 540 450L TOTE

What I need to do in each case listed above is isolate the numeric number with the "L". So in a perfect world the formula to do this would extract the following in each case:

450

1150

450

Thanks in advance for any suggestions or ideas.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 12 Mar 2012 at 8:32am
i don't think there is an easy way to do this, but you could try something like formula
if table.descriptions = "WEATHERMAX 450L" then mid(table.descriptions,12,3) else
if table.descriptions = "WEATHERMAX 1150L" then mid(table.descriptions,12,4) else
if table.descriptions = "RT 540 450L TOTE" then mid(table.descriptions,8,3)
IP IP Logged
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