Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with SELECT
Message
 
 
À
05/08/2011 11:21:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01520239
Message ID:
01520242
Vues:
101
This message has been marked as the solution to the initial question of the thread.
>Can some one tell me why the WHERE clause in this select is being ignored? It pulls all the records.
>
>
>thisfield = 'current.sc1_2000'
>
>SELECT st_name, Current.* ;
>FROM tipdatabase!tip T ;
>INNER JOIN tipdatabase!current  ;
>ON t.tip_id = current.tip_id ;
>WHERE ALLTRIM(eval(thisfield)) = "STP"
>
>
>Thanks

You can not use Eval here. You need to either use Macro substituon, or generate the whole select dynamically and still execute it using macro or execscript() function.

So,
SELECT st_name, Current.* ;
>FROM tipdatabase!tip T ;
>INNER JOIN tipdatabase!current  ;
>ON t.tip_id = current.tip_id ;
>WHERE alltrim(&thisField) = "STP"
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform