Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't seem to perfect syntax
Message
From
08/04/2011 11:31:50
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Can't seem to perfect 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:
01506636
Views:
96
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
Thanks, Randy
Next
Reply
Map
View

Click here to load this message in the networking platform