>You're grouping on field Dtyme from the cursor not on the expression. In VFP SQL Statement a field oways wins over alias in GROUP or SORT by
>Change the alias so it doesn't match the field name. BINGO!
I improved the code like this:
>>SELECT LEFT(Dtyme,18) AS Dtyme2, AVG(DCreading) AS DCreading, ;
>> SPACE(10) AS cDate, SPACE(8) AS cHourMin ;
>>FROM CPdata WHERE RType=[DC] ;
>> GROUP BY Dtyme2, cDate, cHourMin ORDER BY dTyme ;
>> INTO CURSOR CPchart READWRITE
>>BROWSE TITLE [Data to Chart]
>>
Thanks mucho! Screenshot attached.
Randy Bosma
VFP - Because life is too short to code in something else...