Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL and DELETED()
Message
From
19/12/2002 06:05:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00733705
Message ID:
00734426
Views:
26
>Hilmar,
>"..the nvl() you mention in your next message.."
>You must be a clairvoyant. I logged in on UT to improve the example in a next message and then read your comment. :)

Actually, I read both messages and then replied to the first one only. At that point, I hadn't noticed that you used iif(isnull(... instead of the simpler nvl().

Please note that in any SELECT, the fields should be a constant size, or else. For instance, for type currency, you should use nvl(MyField, $0) (instead of just 0). In this case, if AGpercent doesn't have more than 3 digits, I think you are safe.

Hilmar.

>Ok, here's the improved code. Hope this will help others somewhere who seek for help on UT with regard to this topic.

>
>
>	select ;
>		a.*, ;
>		NVL( b.AGpercent, 100 ) as AGpercent, ;    && 100 in case of a eof() in c_AG
>		NVL( c.percent  , 100 ) as PTpercent ;     && 100 in case of a eof() in c_PT
>		from c_srf_details a ;
>		left outer join c_AG b on a.empno = b.empno ;
>		left outer join c_PT c on a.empno = c.empno ;
>		into cursor c_ovw1
>
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