Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with Nulls 1

Status
Not open for further replies.

ganjass

Technical User
Dec 30, 2003
154
GB
CR9
Progress 9.1C
Merant Driver

Hi All

I'm using the merant driver to connect to progress. the merant driver doesn't like array fields so you have to use a SQL convert statement. The issue i have is with the subsequent use of it in formulae to split the array field into the subsequent components and then format it when the value of the field is null. If it is Null i want to pass an empty string to the report the formulae i am using are:

%Employer Town
(
{fn convert(pro_element("si-alpha",5,5), SQL_CHAR)}
)

@EmployerTown
(
split({%EmployerTown},"*")[1]
)

and then using it in:
@HomeDisplay
whileprintingrecords;
numberVar MaxLength := 25;

If Length({@EmployerTown}) < MaxLength then
{@EmployerTown} + Space(MaxLength - Length({@EmployerTown}))
Else
Left({@EmployerTown},MaxLength)


I've tried
if not isnull({%EmployerTown})
then
(
split({%EmployerTown},&quot;*&quot;)[2]
)
else
&quot; &quot;

and variations of but still keep getting the error messages about null values.

Thanks in advance




 
Try

if isnull({%EmployerTown})
then
&quot; &quot;
else
(
split({%EmployerTown},&quot;*&quot;)[2]
)

Crystal design assumes that you stop when you find a null, unless you first test for it.

Alternatively, Crystal 8.5 allows you to interpret all nulls as spaces, [Report Options] under [File].

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top