Criteria picking up the single digit number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a very simple table and query where the criteria is suppose to give me
any number between 15 and 30. But it is also giving the number 2, and I
don't no why.

I have tried changing the data type of the field, and then I get a mismatch
data type in expression error.

This has got to be a simple fix, but I am pretty new to Access and this is
killing my spirit.

Help!!!

Thanks
 
It sounds to me that your "number" is actually of *String/Text* type since
in this case:

"15" < "2" < "30"

as in String comparison, Access/JET only compares one character at a time.
Only when the characters being compared are the same, then Access/JET will
compare the next character.

You may need to modify the Table Field to numeric. If that is not possible,
create a Calculated Field (hidden if you want):

FieldNumVal: Val([YourField])

and then set your (numeric) criteria against this Calculated Field.
 
Back
Top