Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this a BUG?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Is this a BUG?
Miscellaneous
Thread ID:
00798818
Message ID:
00798818
Views:
54
I read carefully what the help sais about SET ENGINEBEHAVIOR 70 | 80 & what are the diferences between VFP 7.0 & 8.0 in GROUP BY clause. Help sais"

********
The GROUP BY clause must list every field in the SELECT list except for fields contained in an aggregate function, such as the COUNT( ) function. In addition, the GROUP BY clause must also list every field in a HAVING clause except for fields contained in an aggregate function.
*********

I have the following example:
CLOSE DATABASES ALL
CREATE TABLE DooSumi (NadvDoo N(14,2), SumaDoo N(14,2), Mes N(2), God N(4), Egn C(10))
CREATE TABLE AddSum (Bruto N(14,2), Mes N(2), God N(4), Egn C(10))
INSERT INTO DooSumi (NadvDoo, SumaDoo, Mes, God, Egn) VALUES (100, 50, 2, 2003, "1111111111")
INSERT INTO DooSumi (NadvDoo, SumaDoo, Mes, God, Egn) VALUES (120, 50, 2, 2003, "1111111111")
INSERT INTO DooSumi (NadvDoo, SumaDoo, Mes, God, Egn) VALUES (120, 50, 2, 2003, "1111111111")

INSERT INTO AddSum (Bruto, Mes, God, Egn) VALUES (100, 2, 2003, "1111111111")

SELECT SUM(NadvDoo + SumaDoo) + NVL(AddSum.Bruto,0) AS All_Nadv;
FROM DooSumi;
LEFT JOIN AddSum ON DooSumi.Egn+STR(2003,4)+STR(2,2) == AddSum.Egn + STR(AddSum.God,4)+STR(AddSum.Mes,2);
WHERE DooSumi.Egn == "1111111111" .AND. DooSumi.Mes == 2 .AND. DooSumi.God == 2003;
GROUP BY DooSumi.Egn, DooSumi.Mes, DooSumi.God;
INTO CURSOR TempDoo

and VFP 8.0 rises the error SQL: GROUP BY clause is missing ot invalid"
when I remove "+NVL(AddSum.Bruto, 0)" everything is OK. I thing the All_Nadv Field in TempDoo IS agregate, but maybe I am wrong ???
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Next
Reply
Map
View

Click here to load this message in the networking platform