Results 1 to 2 of 2

Thread: Determining Total Sales

  1. #1
    Join Date
    Nov 2005
    Location
    Seattle
    Posts
    5

    Determining Total Sales

    I am attempting to calculate the total sales from two columns. One column is the quantity of the particular item and the other column is entitled price. I need to calculate the total sales price between these two columns. I tried entering the string as:
    select sum(quantity)*(price) from my database.
    Is this the correct equation for calculating total sales?

    Thanks,
    Ron

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    quantity*price will give you total sales for the each row

    sum(quantity*price) will give you total sales for the entire table

    sum(quantity*price) with a group by clause will give you total sales for the entire group

Posting Permissions

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