Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL & global variables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00128569
Message ID:
00128590
Vues:
25
>I have an SQL statement where I'm using global variables as filters. When execute the select, it doesn't seem to recognize the values of the variables and does a general select.
>
>Ex:
>
>SELECT ass_l_ata,s_or_type FROM temp ;
>INTO CURSOR cleared ;
>WHERE s_status = 'Cleared' AND ass_l_dept = gcDeptNo ;
>AND mnemonic = gcProject AND ass_l_grp = gcGroup ;
>ORDER BY ass_l_ata
>
>SELECT ass_l_ata,s_or_type FROM temp ;
>INTO CURSOR outstanding ;
>WHERE ass_l_dept = gcDeptNo ;
>AND mnemonic = gcProject AND ass_l_grp = gcGroup ;
>AND NOT s_status = 'Cleared' ;
>ORDER BY ass_l_ata
>
>VFP doesn't seem to recognize the values of the variables.

Is that the actual code (cut and pasted) from the program, or did you type it again? Also, I would use parenthesis just in case:
SELECT ass_l_ata,s_or_type FROM temp ;
INTO CURSOR cleared ;
WHERE (s_status = 'Cleared');
AND (ass_l_dept = gcDeptNo) ;
AND (mnemonic = gcProject) ;
AND (ass_l_grp = gcGroup ;
ORDER BY ass_l_ata
			
SELECT ass_l_ata,s_or_type FROM temp ;
INTO CURSOR outstanding ;
WHERE (ass_l_dept = gcDeptNo) ;
AND (mnemonic = gcProject) ;
AND (ass_l_grp = gcGroup) ;
AND (s_status <> 'Cleared') ;
ORDER BY ass_l_ata
BBHTH! (Baffled, but hoping to help)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform