Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL error from VFP6 to VFP9
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01000858
Message ID:
01000864
Views:
20
>SELECT colltemp.*,COUNT(ctemp_name) AS r_count FROM colltemp ;
> HAVING r_count > 0 GROUP BY ctemp_name INTO CURSOR tmpQuery
>
>Went from VFP6 to VFP9 and now I am getting "Group by clause is invalid or missing"
>
>Anyone know what is wrong?
>
>Brenda

Brenda,
SQL Behavior has been changed since VFP 7, espacialy for GROUP BY cvlause. Now GROUP BY must contain ALL non agragated fields in SELECT clause, to make this SELECT works you must do:
old_seb = SET("ENGINEBEHAVIOR")
SET ENGINEBEHAVIOR 70 && BTW See the help for this command
SELECT colltemp.*,COUNT(ctemp_name) AS r_count FROM colltemp ;
       HAVING r_count > 0 GROUP BY ctemp_name INTO CURSOR tmpQuery
SET ENGINEBEHAVIOR old_seb
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform