GROUP BY Question!!

Results 1 to 2 of 2

Thread: GROUP BY Question!!

  1. #1
    mercury Guest

    Default GROUP BY Question!!

    I have sales tables as follows <BR>UserID SF_JanSales, SF_FebSales, SF_Comments<BR>1 1000 5000 testing<BR>1 500 6000 test<BR>2 3000 5666 XXXX<BR>My Employee Table <BR>EmployeeID Lastname<BR>1 A<BR>2 B<BR><BR>Now I need to display the records group by Employee name<BR>I have the following SQL statement...<BR>SqlStr = "SELECT SF_Comments, LastName,FirstName FROM salesForecast, Employee WHERE UserID=EmployeeID group by UserID,Period_End_Date"<BR> Set rs = Conn.Execute(SqlStr)<BR><BR>I get the following error<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] You tried to execute a query that does not include the specified expression &#039SF_Comments&#039 as part of an aggregate function. <BR><BR>I am running Access 2000<BR><BR>Please HELP ME!!<BR>thanks a lot!!<BR>

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default got it all wrong

    the syntax is way off<BR><BR>R&D the group by clause<BR><BR>you can only gruop by values that are in your select clause

Posting Permissions

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