Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't seem to perfect syntax
Message
From
08/04/2011 14:18:34
 
 
To
08/04/2011 11:31:50
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01506636
Message ID:
01506689
Views:
37
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform