Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL - VFP8 and SetEngineBehavior
Message
From
25/01/2006 14:40:35
 
 
To
25/01/2006 14:24:50
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01090249
Message ID:
01090254
Views:
10
Standard SQL requires that when there's a group by, every column either:
a) Be part of a function i.e. Sum, AVG, MAX, etc.
b) Be included in the group by.

Not all your columns that are not SUMMED are part of your group by.

>How can I make the following SQL work under VFP8 without using the SetEngineBehavior command?
>
>
>		INSERT INTO tAcctCont ;
>			(;
>			iTransact, ;
>			transtype, ;
>			Acct_ID, ;
>			econ, ;
>			emat, ;
>			nprofits, ;
>			erforfeit, ;
>			vesteddist, ;
>			othforfeit, ;
>			nprofitsvd, ;
>			totdistrib, ;
>			ibucketid, ;
>			planid, ;
>			empid, ;
>			contrib_dt ;
>			) ;
>			SELECT ;
>			iTransact, ;
>			transtype, ;
>			Acct_ID, ;
>			SUM(econ) AS econ, ;
>			SUM(emat) AS emat, ;
>			SUM(nprofits) AS nprofits, ;
>			SUM(erforfeit) AS erforfeit, ;
>			SUM(vesteddist) AS vesteddist, ;
>			SUM(othforfeit) AS othforfeit, ;
>			SUM(nprofitsvd) AS nprofitsvd, ;
>			SUM(totdistrib) AS totdistrib, ;
>			ibucketid, ;
>			planid, ;
>			empid, ;
>			contrib_dt ;
>			FROM tAcctContTEMP ;
>			GROUP BY 1, 3
>

(On an infant's shirt): Already smarter than Bush
Previous
Reply
Map
View

Click here to load this message in the networking platform