Solved

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

Posted on 2007-11-15
4
1,031 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
ID: 20294930
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
ID: 20294938
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
ID: 20296383
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
ID: 31409480
Thank You.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Mask on Parameter CR2008 28 43
Crystal 11 Suppress main report section if subreport is blank 24 88
Get the parent node - XMLTYPE 9 56
Oracle query output question 4 36
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup

910 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

24 Experts available now in Live!

Get 1:1 Help Now