Jump to content

Calculate Min,Max values from multi-dimensional arrays


Guest BinaryVision
 Share

Recommended Posts

Guest BinaryVision

I have the results of a SQL query returned to an array via the GetRows method. Then I need to go back to the array and determine the min and max values of the first value (column) of each record returned. It appears that the _ArrayMin and _ArrayMax functions are only designed to work with a one-dimensional array. Is there an easier way to do this other than looping through the first value in every record and assigning that to a one-dimensional array to then run the min/max functions on? Thanks for any input in advance!

Link to comment
Share on other sites

Guest BinaryVision

I found a quick workaround for this type of situation. Since I'm already using ORDER BY in my SQL query and the first value of each row is what I want to look at, I can just take the [0][0] position as the Min number and [uBound($qryresult,1) - 1][0] as the Max number. I wanted to do this without hitting the database again which is why I'm trying to do this in the code. Cheers!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...