Why is the search term not working on the MS Access number field that is indexed?

Create a table in Access with a field long int. Set the field to be indexed (any type). Create one record with a value of 1. Then create a query that searches for all records in this table with a value less than 5. Works. Now find records with a value less than 5.5. It fails.

Should Microsoft be notified? I cannot find a way to get around this other than deleting the index.

+3


source to share


1 answer


This is the index. It expects an integer, while 5.5 inherently seems to be translated to decimal.

So, when setting up your filter, first convert using any function that always returns an integer:



Int, Fix, CInt, CLng, CByte, even CBool

+1


source







All Articles