Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Find Range of Ranges


wacole
 Share

Recommended Posts

Have several fields which are described as a range, with a pair of minimum and maximum fields for each. [E.g. SoilPHMin, SoilPHMax .... etc.]

 

User can separately define a range for one or more of these fields to search for. For example if the user wants to find all records with a SoilPH range between 1 and 5, a correct response would be not only the record(s) that have a min of 1 and max of 5, but ALSO records where the min would be equal to or greater than 1 AND the maximum would be equal to or less than 5. [i do a pre-processing check to make sure the min is not greater than the maximum, etc.]

 

I've set up global fields to capture the search request min/max values and then convert those to a global range value, but I'm having a brain block about how to take that data and give me the result I need. Maybe I'm approaching this in the wrong way.

 

A clue or two would be greatly appreciated. I've got to be staring the solution in the face, but I'm just not seeing it.

 

Bill Cole

 

Thanks very much as always.

Link to comment
Share on other sites

So SoilPHMin contains a single number (let's say 2) and SoilPHMax also contains a single number (let's say 5)?

 

And you want to enable your end users to do a find for all records with a SoilPH between a specified minimum and a specified maximum, say 3 thru 6?

 

Assuming your users do their min and max input into a pair of global number fields...

 

Enter Find Mode []

Set Field [YourTable::SoilPHMin; "≥ " &YourTable::g.FindMin]

Set Field [YourTable::SoilPHMax; "≤ " & YourTable::g.FindMax]

Set Error Capture [On]

Perform Find []

 

in this example your hypothetical rec would not be found by that criteria: it fits for Max (the specified SEARCH max exceeds the record MAX) but it flunks on Min (the specified SEARCH min is higher than the record min, meaning the record min is too low to fit the description searched for).

 

Sound right?

Link to comment
Share on other sites

Thanks very much. Absolutely correct; the record with min of 3 and max of 6 would be outside the search range of min 2 and max 5.

 

Using these criteria, the following ranges would pass:

2..4.5

3..5

4..4 [it's possible, though not likely, that the min/max (PH in this case) can be the same]

 

These ranges would not pass:

1..4

1.9..5

2..5.01

 

I really appreciate your helping me out on this. Great learning experience.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use