Solved

Business Objects, Crystal Reports, XI, Extracting Data from a memo field.

Posted on 2007-11-15
4
1,029 Views
Last Modified: 2013-12-19
How do I extract text from a memo field in crystal. For example:

Subject: (Order# 9987) This is an order. (Order# 9976) This is the second order.

I want to only display the text after the last order number. For this example I would only want to explay "This is the second order"

Subject: (Order# 9987) This is an order. (Order# 9976) This is the second order.  (Order# 9982) This is the third order.

For this example I would only want to print "This is the third order"



0
Comment
Question by:angeleam
  • 2
4 Comments
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
What is in the txt field?

One way you can do this is with the split function

StringVar Array Orders[];
NumberVar  NumOrders;
NumberVar ThisLoc;

Orders := Split({YourMemoField},'(Order#');
NumOrders := Ubound(Orders);
ThisLoc := Instr(Orders[NumOrders],'This');
Mid(Orders[NumOrders],ThisLoc);

mlmcc
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
In checking the InStr function there may be an easier solution

NumberVar ThisLoc;
ThisLoc := InStrRev({YourMemoField},"This");
Mid({YourMemoField},ThisLoc)

mlmcc

0
 
LVL 28

Expert Comment

by:Naveen Kumar
Comment Utility
In oracle, you can do it like this :

select substr(clob_field,instr(clob_field,') ',-1)+2)
from your_table;

also to test it, you can use the below :

SELECT SUBSTR('(Order# 9987) This is an order. (Order# 9976) This is the second order.  (Order# 9982) This is the third order. ',
              INSTR('(Order# 9987) This is an order. (Order# 9976) This is the second order.  (Order# 9982) This is the third order. ',
                  ') ',-1)+2
             )
FROM dual

Thanks
0
 

Author Closing Comment

by:angeleam
Comment Utility
Thank You.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now