Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2007
    Posts
    2

    Unanswered: Retrieve Min and Max Values in Access

    I have a set of data that contains a machine number and a length and width for each order under that machine number. For example:
    Machine Order Length Width
    abcdef 123 12 45
    abcdef 124 15 30
    zampo 456 18 32
    zampo 457 20 16

    I want to extract the min and max value for each machine.
    Example

    abcdef max length 15 and max width 45
    min length 12 and min width 30
    zampo max length 20 and max width 32
    min length 18 and min width 16
    I would like it to to be in a table so I can export look like the following:
    machine min length max length min width max width
    Any help is appreciated.

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Create a new query, go to SQL view, and put this in

    Code:
    SELECT MACHINE, 'MAX' AS TYPE, MAX(LENGTH) AS LENGTH,  MAX(WIDTH) AS WIDTH
    FROM yourtable
    GROUP BY MACHINE
    UNION ALL
    SELECT MACHINE, 'MIN' AS TYPE, MIN(LENGTH) AS LNGTH, MIN(WIDTH) AS WIDTH
    FROM yourtable
    GROUP BY MACHINE
    Just save the query, and you can export the output to excel.
    Last edited by RedNeckGeek; 02-20-07 at 13:15.
    Inspiration Through Fermentation

  3. #3
    Join Date
    Feb 2007
    Posts
    2
    Thanks! It worked beautifully.

Posting Permissions

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