Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2007
    Posts
    11

    Unanswered: Sum total of columns

    I have created a query to display a set of item Ids and the price of each item. I now want to make a report showing the totalt number items and the sum total of all the prices.

    Any hints as to how this is done?

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    SELECT Count(itemID) As [NumberOfItems]
         , Sum(Price) As [SumOfPrices]
    FROM   MyTable
    This is as good an answer I can give without more information (such as your table design).
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by nikolaistavrogin
    I have created a query to display a set of item Ids and the price of each item. I now want to make a report showing the totalt number items and the sum total of all the prices.

    Any hints as to how this is done?

    if its in a report..... why not use the SQL aggregate functions in a group footer
    eg
    =sum([price])
    ..assuming you have a column called price that you want to sum
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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