Peter, I want to force each entry to group as of the 1st of the month, hence the Date(YY,MM,1) function, but obviously this doesn't work. I need to pass the data into a graphing class which expects dates to be specified along the x axis and want to group monthly totals together.
However the work around is certainly not obvious if you want to do it as cleanly as possible (i.e one single SQL statement) and I'm still trying some other combinations but I'll log it as an error anyway. Also as a slight deviation, Ted suggested that the "Select all" is inappropriate and I'd ask why please? I certainly have always used it within joins to no adverse effect and can't see why this is wrong - Ted, please elucidate ??? I thought that you either used distinct or all as they are obviously mutually exclusive regardless of the group by clause. Dave Crozier -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Cushing Sent: 26 June 2007 14:49 To: [email protected] Subject: Re: SQL "Group By" error?? Dave Crozier wrote: > Hi Folks, > I just came across what I think is a VFP error and I’m wondering should it > be reported. > > If you group by a field generated by the Date(...) function then VFP throws > an error. > > Could someone confirm this is the same in VFP8 and VFP7 and if it has been > spotted previously as an error. > Hi Dave, You can also do it with: Select All ; test.date-DAY(test.date)+1 as Sort_Key, ; Sum(Test.nValue) as Column_Value ; From Test ; group by 1 ; Into Cursor curAll ; Order By 1 Peter [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

