Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't seem to perfect syntax
Message
De
08/04/2011 14:18:34
 
 
À
08/04/2011 11:31:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01506636
Message ID:
01506689
Vues:
38
>Hi. Please note that I am a VFP7 user.
>
>Issue: I want a loop that will summarize for each salesman, then do a total for all. My issue is how to format my 'mysm' variable to insert in a sql without error.
>
>Simplified example:
>
>
>IF NOT EOF('query1')
>   mysm ='salesmn' = + ALLT(query1.salesmn) + ' And'
>ELSE
>   mysm = ''
>ENDIF
>
>
>The resulting query expanded:
>
>IF NOT EOF('query1')
>   SELE * from INVOICES where salesmn = 'Randy Waldman'  And  glyear = 11
>ELSE
>   SELE * from INVOICES where glyear = 11
>ENDIF
>
Are you sure there are quotes around the name in the expanded query? You're not putting them there. Try:
mysm ='salesmn = [' + ALLT(query1.salesmn) + '] And'
Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform