Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where Clause Problem
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01387776
Message ID:
01387780
Views:
105
This message has been marked as the solution to the initial question of the thread.
Instead of EVAL use macro &

That's what you need to use with SQL.

See my change inside your code.

>Hi All,
>
>This code give no error
>
>
>
>m.cCondit = '.T.'
>
> SELECT DISTINCT ;
>   E.nType ,;
>   R.lassimille , ;
>   CAST( ICASE( INLIST( .F. , E.ltransfert , M.lcondit ) , E.ltransfert ,;
>   ICASE( D.ddate <= m.dlimit , .T. , .F. )) AS L ) AS ltransfert ,;
>   NVL( SUM( ICASE( E.nPosCat = 1 , 1 , 0 ) ) , 0 ) AS nCat_O,;
>   NVL( SUM( ICASE( E.nPosCat = 2 , 1 , 0 ) ) , 0 ) AS nCat_A,;
>   NVL( SUM( ICASE( E.nPosCat = 3 , 1 , 0 ) ) , 0 ) AS nCat_B,;
>   NVL( SUM( ICASE( E.nPosCat = 4 , 1 , 0 ) ) , 0 ) AS nCat_C,;
>   NVL( SUM( ICASE( E.nPosCat = 5 , 1 , 0 ) ) , 0 ) AS nCat_Cd;
>   FROM  amline!Etats E;
>   INNER JOIN DatesFiltred D ON D.ddate BETW E.ddebut AND EVL( E.dfin , m.dfin ) ;
>   INNER JOIN amline!Resident R ON R.iid = E.iresidentid  ;
>WHERE R.iid = 3065 GROUP BY 1,2,3 INTO CURSOR Categ READWRITE
> 
>
>
>But This code code give bad result
>
>
>m.cCondit = "R.iid=" + TRANSF( 3065 )
>
>SELECT DISTINCT ;
>   E.nType ,;
>   R.lassimille , ;
>   CAST( ICASE( INLIST( .F. , E.ltransfert , M.lcondit ) , E.ltransfert ,;
>   ICASE( D.ddate <= m.dlimit , .T. , .F. )) AS L ) AS ltransfert ,;
>   NVL( SUM( ICASE( E.nPosCat = 1 , 1 , 0 ) ) , 0 ) AS nCat_O,;
>   NVL( SUM( ICASE( E.nPosCat = 2 , 1 , 0 ) ) , 0 ) AS nCat_A,;
>   NVL( SUM( ICASE( E.nPosCat = 3 , 1 , 0 ) ) , 0 ) AS nCat_B,;
>   NVL( SUM( ICASE( E.nPosCat = 4 , 1 , 0 ) ) , 0 ) AS nCat_C,;
>   NVL( SUM( ICASE( E.nPosCat = 5 , 1 , 0 ) ) , 0 ) AS nCat_Cd;
>   FROM  amline!Etats E;
>   INNER JOIN DatesFiltred D ON D.ddate BETW E.ddebut AND EVL( E.dfin , m.dfin ) ;
>   INNER JOIN amline!Resident R  ON R.iid = E.iresidentid  ;
> WHERE &cCondit  GROUP BY 1,2,3 INTO CURSOR Categ READWRITE
>
>
>
>I don't know the reason....
>
>Thank in advance for help
>
>bernhart
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform