Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL and DELETED()
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00733705
Message ID:
00734370
Views:
30
Peter,

Yes, you can not use any function that takes an alias as an argument and expect it to work inside a SELECT, if there are multiple tables involved in the SELECT. This is the way FoxPro has worked forever.

The isnull() test would work in your left joins below, because it will evaluating the result set data.

You could alternately use NVL() alone to convert a null value to a default value.

>>So, I guess this one needs revision also:
>>
>>
>>	select ;
>>		a.*, ;
>>		Iif( Eof( 'b' ), 100, b.AGpercent ) as AGpercent, ;
>>		Iif( Eof( 'c' ), 100, c.percent )   as PTpercent ;
>>		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
>>
>>
>>Hmm, wonder why it has always given correct results. Or didn't it???
>
>My latest tests confirm the fallacy. A possible solution might be:
>
>
>	select ;
>		a.*, ;
>		Iif( ISNULL( b.AGpercent ), 100, b.AGpercent ) as AGpercent, ;
>		Iif( ISNULL(   c.percent ), 100, c.percent   ) as PTpercent ;
>		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
>
>
>What do the gurus think about this? (At this moment I feel like a beginner. :)
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform