Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL error for blank child table
Message
From
07/05/2003 09:58:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
07/05/2003 09:51:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00785687
Message ID:
00785784
Views:
20
>>When 2nd table has no matching records returned value is null causing sum() to be null. Check 'set null'. Also you can change your expressions to handle nulls. ie :
>>
>>instead of :
>>SUM(Stockout.nqtyout)-SUM(Stockout.nqtyret) AS qtyout
>>try :
>>SUM( nvl(Stockout.nqtyout,0)-nvl(Stockout.nqtyret,0) ) AS qtyout
>
>Çetin,
>
>I agree in principle, but I suspect that that can cause fields that are too narrow (if the first records happen to have null values): better replace the 0 with something like 000000.00, or with $0, depending on the field type.

Right, didn't care that. Especially if this is a view I'd take extra care to always have a fixed size value returning expressions (base table structure has changed ... thing).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform