>Hello Mo,
>
>
>Here is a sample of SQL statement from Oracle for which I have no idea
>about how it can be even implemented in VFP:
>
>SELECT gesch.gesch,bls.rechwk_zud, bls.ztgja_gj, bls.kj, bls.BUCH_ART,;
> bls.zttga_whg , BLS.KZ_SCHAETZ,BLS.BUCH_ART,;
> SUM(iif(kz_beitr_1='J', betr, 0)) as beitrag_1,;
> SUM(iif(kz_erg_1='J', betr, 0)) as ergebnis_1,;
> SUM(iif(kz_beitr_2='J', betr, 0)) as beitrag_2,;
> SUM(iif(kz_erg_2='J', betr, 0)) as ergebnis_2;
> FROM gesch, bls02 bls;
> WHERE bls.rtgts_gesch(+) = gesch.gesch;
> AND bls.buch_art(+) NOT IN ('I','K','Y');
> AND DECODE(floor(bls.kj(+)/1997),1, 1,floor(bls.ztgja_gj(+)/1997 ))=1;
> GROUP BY gesch.gesch, bls.rechwk_zud, bls.ztgja_gj, bls.kj,;
> bls.BUCH_ART, bls.zttga_whg , BLS.KZ_SCHAETZ,BLS.BUCH_ART
>
>
>DECODE(floor...) stands for the following condition
> bls.kj(+) >= 1997 or bls.ztgja_gj(+) > 1997
>Obviously, it doesn't match to :
> bls.kj>= 1997 or bls.ztgja_gj > 1997... Or it does?
>The author told me that he doing it because (+) are forbidden with OR...
>I do understand how to convert the first two rows of Where clause (outer
>joins on subsequent queries), but stumped on the last one...
>Please, if you have any thoughts or just ideas about conversion, let me
>know....
*************************
Hello Vladimir
Decode senetence is : DECODE(Value,if1,then1,if2,then2,....,else)
In foxpro it is IIF()
that is mean:
DECODE(floor(bls.kj(+)/1997),1, 1,floor(bls.ztgja_gj(+)/1997 ))=1;
EQUAL TO :
IIF(floor(bls.kj(+)/1997) = 1,1,floor(bls.ztgja_gj(+)/1997 )) = 1
I hope that will help
Good luck
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only