Results 1 to 3 of 3

Compare Numbers in Different rows to for highest and lowest value

  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    791

    Compare Numbers in Different rows to for highest and lowest value

    I have made it this far



    Attached is the output of a query. 117DVM.zip

    Using 117Dual query to find the parent_ID values of the Mount, the radio, Channels 1 and 2.

    How do I compare the values of the unique_id assigned to a parent_equipment_item_id? First one is to assign the first radio which has the lower unique-id, and the second to the higher of the 2. There are 2 radios assigned to the mount.

    After we get the unique_id of the lower value we can use that to repeat the process for the channels

    Click image for larger version. 

Name:	117.PNG 
Views:	13 
Size:	9.2 KB 
ID:	31822

    In the above pic the first column is the primary unique_id we start off from. Using that number, we look in the parent_equipment_item_id where the Equip LIN column is a certain value shown in the Green box. There should be 2 assigned.
    How do I determine the lower value of the two in the green box?

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    7,738
    can you just create a 'Find Duplicate' query?
    Use the query wizard , and make the 'Find Duplicate':

    SELECT Data.[parent_equipment_item_id], Data.[ID], Data.[Equip LIN], Data.[unique_id]
    FROM Data
    WHERE (((Data.[parent_equipment_item_id]) In (SELECT [parent_equipment_item_id] FROM [Data] As Tmp GROUP BY [parent_equipment_item_id] HAVING Count(*)>1 )))
    ORDER BY Data.[parent_equipment_item_id];


    and if you already have a UNIQUE_ID field, why do you have an autonumber field too?

  3. #3
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    791
    Ranman256,
    Good point on id as extraneous, once done troubleshooting, I will take it out and use unique_id as the link.

    I see what you did with the query, but I still need to use which is lesser to determine which is gadget 1.

    Click image for larger version. 

Name:	out.PNG 
Views:	8 
Size:	33.5 KB 
ID:	31830

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

Similar Threads

  1. Conditional formatting to compare rows on a form
    By william barker in forum Forms
    Replies: 1
    Last Post: 01-03-2017, 01:24 PM
  2. Replies: 1
    Last Post: 10-05-2016, 08:20 AM
  3. Replies: 1
    Last Post: 02-08-2015, 08:11 PM
  4. Replies: 1
    Last Post: 02-06-2013, 12:18 PM
  5. Replies: 9
    Last Post: 11-04-2012, 10:46 PM

Posting Permissions

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