Jan, The rules for group by are these:
Every column you select between SELECT and FROM must also be in the GROUP BY clause, unless it is in an aggregate expression within the SELECT clause. The aggregate functions are SUM, AVG, MIN, MAX, and COUNT (*). The items that are not in aggregate functions are the definitions of your "groups." If you are grouping by custno, invoice#, then you want to compute some aggregate values for every distinct combination of customer number and invoice number. So for deldate, netsales, and paid_yn, (which look from the query like details, not aggregated calculations for groups of details), you would have to do things like MAX (deldate), or SUM(netsales). Otherwise, you could include them in your GROUP BY clause to see them as detail. Bill On Thu, Jun 26, 2008 at 1:46 PM, jan johansen <[EMAIL PROTECTED]> wrote: > I always seem to not get his right. > What is wrong with this? > > SET ERROR MESSAGE 677 OFF > DROP VIEW tCustInvoiceView > SET ERROR MESSAGE 677 ON > CREATE TEMPORARY VIEW `tCustInvoiceView` + > (CUSTNO,INVOICE#,DELDATE,NETSALE$,paid_YN) + > AS SELECT + > CUSTNO,INVOICE#,DELDATE,NETSALE$,paid_YN + > FROM DAYSALES + > GROUP BY CUSTNO, INVOICE# > > gives an error message > -ERROR- Illegal column specification (2512) > If I leave off the group by it works fine. > > Jan >

