Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004
    Posts
    8

    Unanswered: possible SQL query for this function??

    i am trying to write an SQL query for an Access database. in this database i have a table with inventory data. what i want is to select distinct item numbers and sum up all of the inventory quantity for those item numbers. i know how to select distinct item numbers OK from this table, but how can i go through the table and sum the quantities for those item numbers and dump all the results into a new table? that would mean for each distinct item number, there would be one resulting sum for that item. so the table would be 2 columns, one with distinct item numbers and one with their sums. thanks for any help!

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    GROUP BY

    -PatP

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Since it is F-F-F-Friday and I'm seeing out the last 30 mins...

    Code:
     
    SELECT MyDisinctCol, Sum(QuantityCol) AS TheTotal
    FROM MyTable
    GROUP BY MyDisinctCol
    Another 20 secs gone!
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Dec 2004
    Posts
    8
    that did it! thanks for the help...

Posting Permissions

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