Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove null values from cursor
Message
From
08/07/2007 08:34:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01238444
Message ID:
01238447
Views:
9
>This question has probably been asked many times.
>
>Creating a report after combining two cursors. One of the fields ends up with a lot of null values. (using select with join into cursorname)
>
>What's an efficient way to remove those null values from preview and report? I tried in "print object when" field ! isnull(cursorname.fieldname) That apparently doesn't work though.

That should work, IMO. I don't know why it doesn't.

However, what I usually do is to use the NVL() function.

In the report itself, use the expression:
nvl(CursorName.FieldName, "???") && or spaces, if you don't want to show anything
Or, use a similar expression directly in the commands that SELECT the data:
select ..., nvl(SecondTable.MyField, space(15)) as MyField;
   from FirstTable left join SecondTable on ...;
   into cursor Tmp
The above assumes that MyField has 15 characters - it is important to keep the expression, in a SELECT statement, at a constant length.

>
>Thanks in advance!
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform