Eurika!
I see the errors of my ways.
Thanks Sergey.
>Hi Dean,
>
>Your select is invalid because it doesn't specify from which record take values for c.h1psyr, c.h1psmo and c.h1psdy columns. VFP8 by default doesn't allow such selects. See references I provided in previous message for detailed explanations.
>
>>
>>The following select sql statement works under VFP6.0. But does not work in VFP8.0 w/ SP1.
>>
>>SELECT c.h1psyr, c.h1psmo, c.h1psdy, sum(c.h1ramt) as amt, u.u1name ;
>> FROM userunit u, cscash01 c ;
>> WHERE u.u1unit = c.h1unit ;
>> INTO CURSOR ytdcoll ;
>> ORDER BY 5 ;
>> GROUP BY 5
>>
>>All the selected fields are simple character field except the SUM field which is a numberic field.
>>
>>I lost as to why it's not working in VFP8.0.
>>
>>
>>>Dean,
>>>
>>>Never heard about such problem with grouping on date fields. Is it VFP8? If it's, take a look at help under
Behavior Changes Since Visual FoxPro 7.0 and in
INFO: SQL SELECT Behavior Changes in Visual FoxPro 8.0 mskb #
813361.
>>>
>>>
>>>>I was doing some queries and I noticed that when one of the selected field is a date field, the GROUP BY statement gives an "invalid group by ..." error.
>>>>
Work as if you don't need money
Love as if you've never been hurt before
Live as if this is your last day to live
Dance as if no one's watching