Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Split function - How do I get my data out? Post Reply Post New Topic
Author Message
jennifer_falcon
Newbie
Newbie
Avatar

Joined: 15 Jan 2009
Online Status: Offline
Posts: 35
Quote jennifer_falcon Replybullet Topic: Split function - How do I get my data out?
     Posted: 08 Apr 2010 at 10:56am
Good Day,

I have a field in my database called ism.dept.multiple. This field can contain multiple department names.

Example:

Department of Technology
Department of Economics
Department of Tourism

I use a formula called DeptAffected to split out the entries from the field.

numberVar i := 0;
numberVar j := 0;
stringVar out := " ";
stringVar array test := split({cm3rm1.ism.dept.multiple}, chr(10)+chr(13) );
i := ubound(test);
if i > 0 then
   for j := 1 to i step 1 do
        out := out + UpperCase(test[j]) + ", ";
out


This takes the data and puts it into the field looking like this:

DEPARTMENT OF TECHNOLOGY, DEPARTMENT OF TOURISM, DEPARTMENT OF ECONOMICS

There are records that will not have anything in the ism.dept.multiple field.

I want to be able to record which records have data in the ism.dept.multiple field and which records do not.

If a record has information in the field, I would like it to be True. If a record does not have information in the field, I would like it to be False.

The length of the department names vary from department to department.

What formula can I use to distinguish between a record with departments and a record without?

I am using Crystal Reports 9 with a DB2 database.

Thanks!

Jennifer
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Apr 2010 at 3:42am
I would use a shared or global variable to check if i=0, or if out has length >1, then you could check if the value of the variable and proceed from there.
 
HTH
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