Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: aggregate function

    I received this error message when I tried to open a query:
    “You tried to execute a query that does not include the specified expression ‘Customer’
    as part of an aggregate function.”
    I believe it’s referring to the Sum function in my SQL statement below. But why? And how can I fix it?

    SELECT OTShipping.Customer, OTShipping.CustomerNumber, OTShipping.PartNumber, OTShipping.ProductType, Count(OTShipping.ID) AS NumShipments, Sum(-[OTShipping.qlate]) AS NumLate
    FROM OTShipping
    WHERE (((OTShipping.ActShipDate)>=#5/1/2002# And (OTShipping.ActShipDate)<=#5/31/2002#));

    Thank you.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    it wants you to add a GROUP BY clause

    GROUP BY OTShipping.Customer, OTShipping.CustomerNumber, OTShipping.PartNumber, OTShipping.ProductType

    rudy
    http://rudy.ca/

  3. #3
    Join Date
    May 2002
    Posts
    395
    Thank you much!

Posting Permissions

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