Results 1 to 4 of 4
  1. #1
    AccessNubie is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    4

    Talking Query to find lowest value


    Hello: i am an absolute Access beginner. I understand BASIC queries. I want to create a query that compares 7 different fields for the lowest value. The fieldname containing the lowest value should be displayed in the results. Here's an example:

    Field A Field B Field C Field D
    22 10 15 35

    The query should display a column that shows some identifier such as "B" for the above record (which contains the lowest value). As simple as possible would be great - please assume that I do *not* know much at all.... Thank you!!!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If it helps, the fields described indicate you have a normalization issue with your tables. That means you will struggle every time you try and use the table until it is normalized.

  3. #3
    Simple is offline Novice
    Windows XP Access 2000
    Join Date
    Nov 2009
    Posts
    8
    Arrange your table like this:

    Field Field value
    FieldA 22
    FieldB 10
    FieldC 15
    FieldD 35

    Otherwise you'd have to right a ten page iif statement....
    If your table is big and you don't want to manuall create a new one try this...

    To create this Table make a blank table with the above fields. Create a second table that just has a field column with Field A, B, etc.... Create an append query on you new table. Use your existing table and the second table with only the Field column. Pull down your field column twice, change one to where and in the criteria put Not In (Field B, Field C, FieldD), then pull down Field A from your original table next to it. Run it.
    Verify your data. Now remove Field A, add field B and change you where to Not In (Field A, FieldC, FieldD). Rinse and repeat until all your fields are appended. If you save and name each query you can just run it later as a macro if you need to keep you original table the way it is.

  4. #4
    AccessNubie is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    4
    Thank you for the responses. I apologize - there is a piece of info that I neglected to include. The prices, Fields A through D (actually, there are 7 to 8 of those fields) are prices quoted by vendors for an item number. So, the table would actually look like the below. Each month, an employee has to look at approx 40 records, line by line, and indicate the vendor with the lowest price for each item. Also, I'm not sure I understand the above process with creating 2 additional tables. However, maybe this additional item no field will change the approach. thank you again....

    Example:
    Item No. Vendor A Vendor B Vendor C Vendor D Vendor E
    ab1123 95 85 110 105 100

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-30-2009, 05:05 AM
  2. Use query to find and sum data
    By kwelch in forum Queries
    Replies: 3
    Last Post: 11-23-2009, 04:26 AM
  3. Find Records Query
    By sullyman in forum Programming
    Replies: 1
    Last Post: 10-28-2009, 08:49 AM
  4. Replies: 1
    Last Post: 10-06-2009, 02:00 AM
  5. query to find the highest value in a field
    By jhjarvie in forum Queries
    Replies: 0
    Last Post: 09-02-2008, 02:27 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums