Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This Select Group claims to be Missing or Invalid
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01252346
Message ID:
01252381
Views:
27
You can do a select on a memo field, but you can't use it in a 'group by' clause.

>>Hi Randy,
>>With "Set EngineBehavior 80/90" is necessary that ALL fields be in Group By clause and that Memo fields are not allowed.
>>For solve your problem, you can to do a "Set EngineBehavior 70" or you can to follow the rule above and you sould remove Memo's fields of Select clause and add the other fields (out Sum function) in Gorup By clause.
>>Good luck!

>
>Thanks, I may need luck to fix this one. You are correct in the SET ENGINEBEHAVIOR is 90 - trying to be a good up-to-date programmer without reverting to old behavior. My late evening typos are corrected below. When you say Memo fields are not allowed - does that mean only in the GROUP BY or are they prohibited in the SELECT field list as well? I read the help and concluded that they should be left out of the GROUP BY. If I have to leave them out of the SELECT field list, I guess I'll have to generate this report cursor in two parts.....
>
>Thanks,
>
>>
>>>The honor of your assistance is requested. I've spent too many hours looking at this SQL-select statement trying to figure out why "The GROUP BY clause is missing or invalid". In the first part, I've added the field type/size at the end of the line. This is generating a cursor for a report.
>>
SELECT Brk_Name, Brk_Address1, Brk_Address2		, ; && C25 C30 C30
>>>	CtZ_CityName, CtZ_State, CtZ_PostalCode		, ; && C25 C2 C10
>>>	Brk_Contact, Brk_SingleMultiple			, ; && Memo I4
>>>	Brk_ShippingRate, Brk_ShippingRules		, ; && Y8.4 Memo
>>>	CtV_DisplayOrder, CSR_DisplayOrder		, ; && I4 I4
>>>	CtV_StoreName, CSR_CertificateAmount 		, ; && C25 Y8.4
>>>	SUM(COr_Amount) AS COr_Amount_SUM		, ; && Y8.4
>>>	CSR_Discount, CSR_Percent, CSR_OrgPercent	; && N5.2 N6.2 N6.2
>>>FROM ST!CertificateOrder					;
>>>	JOIN ST!CertificateSizeRate ON COr_CSRFK==CSR_PK	;
>>>	JOIN ST!CertificateVoucher ON CSR_CtVFK==CtV_PK		;
>>>	JOIN ST!Broker ON CSR_BrkFK==Brk_PK			;
>>>	LEFT JOIN ST!CityZip ON Brk_CtZfk==CtZ_PK		;
>>>WHERE COr_OrCFK = '00054'					;
>>>ORDER BY Brk_Name, CtV_DisplayOrder, CSR_DisplayOrder		;
>>>GROUP BY Brk_SingleMultiple, Brk_Name				, ;
>>>	CtV_DisplayOrder, CSR_DisplayOrder			, ;
>>>	CtV_StoreName, CSR_CertificateAmount			, ;
>>>	CSR_Discount, CSR_Percent, CSR_OrgPercent		, ;
>>>	Brk_Address1, Brk_Address2				, ;
>>>	CtZ_CityName ,CtZ_State, CtZ_PostalCode, Brk_ShippingRate ;
>>>INTO CURSOR rc_OrderTabReport
>>>It works as expected without the SUM() and GROUP BY. I've made sure all the non-grouped fields are included and that there are no memo fields in the GROUP BY. Can you see what I've missed?
>>>
>>>TIA,
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform