Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Grabbing info from the middle of an open field Post Reply Post New Topic
Author Message
cheryla
Groupie
Groupie


Joined: 23 Oct 2013
Online Status: Offline
Posts: 51
Quote cheryla Replybullet Topic: Grabbing info from the middle of an open field
    Posted: 14 Jul 2014 at 10:12am
I have a notation chars field (We can enter anything into this field). I need to figure out how to grab the $ amount (if there is one) from this field. Below is a sample. There definitely could be more or less info in this field. Is this possible? Any suggestions?

I know that if it was a fixed placement I could use right or left justify or something like it but this can be anywhere.

Any help is welcomed. This would saved hours of manually looking up each order to find this info and enter it into a spreadsheet. Thank you!!

Sample:

6/9/2014 7:40> 1Z611??????941204
$11.63
--DAVE
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 15 Jul 2014 at 7:18am
if the dollar sign is always going to be there, try:

mid({table.field}, instr({table.field}, '$'))

!!EDIT!!

That will produce an error when an amount sign is not there. You said that an amount may not be there. So do:

if '$' in {table.field}
    then mid({table.field}, instr({table.field}, '$'))
        else ''


Edited by FrnhtGLI - 15 Jul 2014 at 7:20am
|< /\ '][' ( )
IP IP Logged
cheryla
Groupie
Groupie


Joined: 23 Oct 2013
Online Status: Offline
Posts: 51
Quote cheryla Replybullet Posted: 16 Jul 2014 at 3:08am
Thank you. I will try this out and let you know.
IP IP Logged
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.031 seconds.