GROUP BY? Please help

Results 1 to 3 of 3

Thread: GROUP BY? Please help

  1. #1
    Join Date
    Dec 1969

    Default GROUP BY? Please help

    Hello,<BR>For some reason my group by sql statement is not working, I have put all session.ID&#039s in a table under the field sessionID.<BR>Here is my statement,<BR>SQLtxt = "SELECT * FROM tblCourseChoice GROUP BY sessionID" <BR> SET objRS = objConn.Execute(SQLtxt)<BR><BR>Here is the error I keep getting:<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Cannot group on fields selected with &#039*&#039. <BR><BR>/aspbin/viewtrainfunreq.asp, line 28 <BR><BR><BR>I have tried to group it by other fields in the DB and get the same error. Any help is more then appreciated,<BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: GROUP BY? Please help

    &#062;Cannot group on fields selected with &#039*&#039. <BR><BR>That means that when you use GROUP BY you cannot SELECT Fields with an &#039*&#039. You must specify each field individually ...<BR><BR>SELECT Field1, Field2, Fields3 ....<BR><BR>Also ... Any field NOT contained in an aggregate function (SUM, MIN, MAX ,AVG ...) must be contained in the GROUP BY Clause...<BR><BR>HTH

  3. #3
    DavudM Guest

    Default You sure you want GROUP BY...

    ..and not ORDER BY? Just askink because I made that mistake before.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts