Jump to content
Sign in to follow this  
Guest BinaryVision

Calculate Min,Max values from multi-dimensional arrays

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!

Share this post


Link to post
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!

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.