Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.NULL. Returned want Blank or 0
Message
From
23/08/2000 15:51:16
 
 
To
23/08/2000 15:35:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00408441
Message ID:
00408455
Views:
11
>I am selecting two records from two tables the second table may not have the matching record yet. I get a ".NULL." back from the select.
>Is there a way to get a 0 (zero) or a blank if there is no match from the LEFT OUTER JOIN? I know that I can ASCAN() the array I was wondering if I can do this in the SELECT???
>
>
>SELECT Crafts.crafttitle, Craftpay.payrate;
> FROM  jobtrack!Crafts;
> LEFT OUTER JOIN jobtrack!CraftPay;
>   ON  Crafts.craftid = Craftpay.craftid;
> INTO ARRAY laData
>
Use NVL() on the fields in the field list.

You will probably need to use SPACE(field_width) with width of the character field and the full width of the numeric field to make sure you get the full width of each field, in case the first record returned has NULL(s)

e.g., assuming crafttitle is c(10) and payrate is n(10,2)

SELECT NVL(Crafts.crafttitle,SPACE(10)) AS crafttitle, ;
NVL(Craftpay.payrate,0000000.00) AS payrate...
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform