Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL syntax problem
Message
From
08/03/2000 13:29:25
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00342976
Message ID:
00343354
Views:
28
>First, why is there an ampersand in front of budget? Second, break the SQL into 2 command and ditch the UNION until you get both working independently. I do not think you need the parens around nLow and nHigh. You could precede them with a question mark, if you want. At the very end of the command, you end it with a semi-colon. That means more of the command continues on the next line. If it does not, delete the last semi-colon. Not that it makes a difference, but I would move the GROUP BY before the ORDER BY.
>
>
>>SELECT lkacode.account, description, lkacode.aie_code, ;
>>       &budget as budget, sum(achecks.amount) ;
>>       FROM N:\artfox2\data\artfox2!lkacode, achecks ;
>>       WHERE lkacode.account = achecks.account ;
>>       AND achecks.entryid between (nLow) and (nHigh) ;
>>       AND lkacode.aie_code = achecks.itemcode ;
>>UNION ;
>>SELECT lkacode.account, description, lkacode.aie_code,;
>>       &budget as budget, 0.0 ;
>>       FROM N:\artfox2\data\artfox2!lkacode ;
>>       WHERE lkacode.account+lkacode.aie_code NOT IN ;
>>       (SELECT achecks.account+achecks.itemcode;
>>       FROM n:\artfox2data\artfox2!lkacode, achecks ;
>>       WHERE lkacode.account = achecks.account ;
>>       AND achecks.entryid between (nLow) and (nHigh) ;
>>       AND lkacode.aie_code = achecks.itemcode) ;
>>       INTO table f:\artfox\led_summ ;
>>       ORDER BY 1, 3 ;
>>       group by achecks.itemcode ;
Mark,

Thanks for you help! I have everything working except when I add the group by
achecks.itemcode I receive a Syntax error while the code is running. I do not understand why the code works in VFP 3.0b and not in VFP 6.0 SP3. Any Ideal ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform