Results 1 to 4 of 4
  1. #1
    jlindquist23 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jan 2019
    Posts
    43

    Min and Max Values in 4 fields of data

    I'm trying to find the min and max values in a record for 4 different fields in a query:


    [HRC_CenterGrind]
    [HRC_CenterSurface]
    [HRC_EndSurface1]
    [HRC_EndSurface2]

    The min and max formulas only allow 2 fields or look for a range of records within the same field.

    I found this formula, but I get an error when I update the query that says it's an undefined function:
    Highest: FieldMax([HRC_CenterGrind],[HRC_CenterSurface],[HRC_EndSurface1],[HRC_EndSurface2])

    I'm ultimately looking for if the difference between the minimum and maximum values in these fields are greater than 4.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    Wherever you found the formula, there should be a function to go with it. The function will need to go in a standard module

    Although I can see why you have these 4 fields in one record, it would be normal practice to have 4 records with a field name identifier, then the problem becomes trivial

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,861
    I seemed to recall that Allen Browne did something like this, and for once my memory was correct.

    See http://allenbrowne.com/tips.html and then http://allenbrowne.com/func-09.html
    The first link also has the MinOfList()

    HTH
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    jlindquist23 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Jan 2019
    Posts
    43
    I used this and it worked! Thank you for your help!
    JL

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

Similar Threads

  1. Replies: 53
    Last Post: 06-24-2021, 10:49 AM
  2. Replies: 3
    Last Post: 12-02-2017, 02:04 PM
  3. Replies: 2
    Last Post: 12-30-2015, 03:07 PM
  4. Replies: 3
    Last Post: 07-19-2012, 06:51 AM
  5. Replies: 1
    Last Post: 12-09-2010, 08:29 AM

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