Charles,
>betw(50, 1, 100) = TRUE
>betw(50, 100, 1) = FALSE
>betw(-1, 0,-100) = FALSE (this is what got me since I was using variables) => Between (adjust_amount,0,due_amount) should be valid but wasn't. The fix is easy, but it got me.
Good one. That's the kind of logic error that is often hard to track down -- when the data falls outside of the range that the programmer had in mind.
So, we need to remember that the second parameter represents the LOW value, and the third the HIGH value.