Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula - Help needed Post Reply Post New Topic
Author Message
carleen
Newbie
Newbie


Joined: 02 Jul 2008
Online Status: Offline
Posts: 29
Quote carleen Replybullet Topic: Formula - Help needed
     Posted: 16 Jul 2008 at 9:14pm
Hi Again
 
A new problem for me but I think this one should be a little easier to resolve (I hope)!  I have a field which contains string such as 'IMPORT FREIGHT - <a product code here>.  What I need is to just pull data in this field where the product code is > than A.  So for example it needs to be "IMPORT FREIGHT - A bla bla".  Then I need another query that just pulls anything except where the code starts with A?  Because this field does not contain the product code at the start I am not sure how to do this.  Any help would be very much appreciated.
 
Thanks!
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 18 Jul 2008 at 4:25am

Hi,

Can you post some sample data and what you want as result.....

Cheers

Rahul

IP IP Logged
carleen
Newbie
Newbie


Joined: 02 Jul 2008
Online Status: Offline
Posts: 29
Quote carleen Replybullet Posted: 18 Jul 2008 at 5:10am
Hi, thanks for your reply.  Below is sample data from this field.
 
IMPORT FREIGHT  -  SHIP4. WHITE  -   WHITE Shipment Testing # 3 With Hang
 
SHIP4 is the product code.  I want two filters.  One which picks up product codes starting with 'A' only and the second which excludes codes starting with 'A'.
 
I want this whole field to appear which I can handle, it is just extracting the right codes as mentioned above.
 
Does that make sense?  Thanks so much!
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 18 Jul 2008 at 11:14am
Hi...
 
Ok now you have to create  4 formulas
 
frm1
trim(mid("IMPORT FREIGHT  -  SHIP4. WHITE  -   WHITE Shipment Testing # 3 With Hang",instr("IMPORT FREIGHT  -  SHIP4. WHITE  -   WHITE Shipment Testing # 3 With Hang",'-')))
output
-  SHIP4. WHITE  -   WHITE Shipment Testing # 3 With Hang
 
frm2
 
output
-  SHIP4.
 
frm3
 
output
  SHIP4.
 
frm4
trim(replace({@frm3},'.',''))
 
output
SHIP4
 
This was you can extract the product code once done check the last formula  with you database field.
 
cheers
Rahul
IP IP Logged
carleen
Newbie
Newbie


Joined: 02 Jul 2008
Online Status: Offline
Posts: 29
Quote carleen Replybullet Posted: 21 Jul 2008 at 10:46pm
Thanks so much for this, but I still dont understand how this can work, as what i sent you was an example of the data, but the data and therefore code could in fact be IMPORT FREIGHT  -  AX100. BLACK  -   BLACK Black Item type" etc...or something else for that matter, the only thing which remains the same is IMPORT FREIGHT so if I could trim this of then I guess your theory would work as this is always a prefix.  Does that make sense?  Can you help me just trim that?  Thanks again
IP IP Logged
carleen
Newbie
Newbie


Joined: 02 Jul 2008
Online Status: Offline
Posts: 29
Quote carleen Replybullet Posted: 22 Jul 2008 at 12:02am
Ignore my stupid reply, I have been able to adapt your wonderful formula to the field and therefore get what I need!  I cannot thank you enough...THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 22 Jul 2008 at 1:04am

Great...........

Embarrassed ohhh u making me blush now.............

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