Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Posts
    1

    Unanswered: Help for newbie with Select statement

    Hello,

    I am having trouble using the select statement to give me a running total from one table in my database. Here is an example:

    Price cost_fee units
    $200 15% 5
    $150 10% 4
    $670 15% 8

    I am trying to get a running total amount for profit. I have been trying things like: sum(price-cost_fee) * units from money_data, and so forth. I have tried everthing that I know how to do, and nothing worked so far. Any help would be much appreciated!

    Thanks in advance,

    Tony

  2. #2
    Join Date
    Sep 2002
    Location
    Montreal, Canada
    Posts
    224
    Provided Answers: 1

    Re: Help for newbie with Select statement

    Originally posted by TANDN32
    Hello,

    I am having trouble using the select statement to give me a running total from one table in my database. Here is an example:

    Price cost_fee units
    $200 15% 5
    $150 10% 4
    $670 15% 8

    I am trying to get a running total amount for profit. I have been trying things like: sum(price-cost_fee) * units from money_data, and so forth. I have tried everthing that I know how to do, and nothing worked so far. Any help would be much appreciated!

    Thanks in advance,

    Tony
    What you want is not clear but how about:

    SELECT
    SUM((price * (1 - cost_fee)) * units)
    FROM
    money_data;

Posting Permissions

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