Not pulling correct data for the "In between" function.

I have a string field of high school gpa which is 4 characters long, i.e., 4.00
I created the tonumber formula on the field.
I need to pull a range from 2.31-2.40 so I say @hsgpa is between 2.30 and 2.41.
It is pulling students with a high school gpa of 2.41 and I don't know why?
Lecia SchusterSystems Technologist/Report ManagerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
Cause BETWEEN filters in almost any language/system with the boudaries being inclusive. Thus you filter for [2.31-2.41]. So you need [2.31-2.40]. Simply change the upper boundary to 2.40.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Lecia SchusterSystems Technologist/Report ManagerAuthor Commented:
Thank you, that seemed to fix my problem.
0
mlmccCommented:
Another reason could be since reals are stored as an approximation, rounding for display shows 2.407 as 2.41

mlmcc
0
ste5anSenior DeveloperCommented:
@mlmcc: it's a string field.
0
Lecia SchusterSystems Technologist/Report ManagerAuthor Commented:
Thank you everyone for your comments.  All comments confirm the best solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.