Results 1 to 3 of 3

Thread: Step a counter.

  1. #1
    Join Date
    Dec 2012
    Posts
    2

    Unanswered: Step a counter.

    Need a little help manipulating data.

    Imagine if you have a webstore. You bye products in stock and you sell it. One month you decide to buy 100 products and you managed to sell 20.

    Date, Product, Bought, Sold
    2012-01,P1,100,20

    Next month, you don't buy anything into stock but you sell 70 products.

    Date, Product, Bought, Sold
    2012-01,P1,100,20
    2012-02,P1,0,70

    The month after that, you need to buy more in stock and you sell 30.

    ..and so on..

    Date, Product, Bought, Sold
    2012-01,P1,100,20
    2012-02,P1,0,70
    2012-03,P1,100,30

    Here's the situation i got. I need to be able to query history data based on product in stock. I wish i could get my output something like this.

    Date, Product, Bought, Sold, Stock(at end of month),
    2012-01,P1,100,20, 80 (100-20)
    2012-02,P1,0,70,10 (80 allready in stock - sold)
    2012-03,P1,100,30,80 (10 allready in stock + bought - sold)

    I would appreciate any input

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002

  3. #3
    Join Date
    Dec 2012
    Posts
    2
    I get the point. But i really don't understand the answer and was looking for a more complete solution

    Maybe an example...

Posting Permissions

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