Sum in Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ysurya
    New Member
    • Aug 2007
    • 1

    #1

    Sum in Query

    I have a table:
    ID_____Mat_____ DelvDate_____Qt yDelv
    1_____ A ______10Jan07__ _____10
    2_____ A ______12Jan07__ _____ 5
    3_____ A _______8Jan07__ _____ 3
    4_____ B ______10Jan07__ _____ 4
    I want to create a query that will return the following result:
    ID_____Mat_____ DelvDate______X
    1_____ A ______10Jan07__ _____3
    2_____ A ______12Jan07__ _____13
    3_____ A _______8Jan07__ _____0
    4_____ B ______10Jan07__ _____4
    Note: X = sum of qty delivered before each delivery date
    How could I achieve this?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Use a subquery to return the sum.

    Comment

    Working...