Subject between operator on a varchar field
Author support

Dear EveryOne,

 

sorry if my question has already been answered – I didn’t find anything relevant.

 

 

I have a query with a between operator on a non-indexed varchar(30) field – currently on FB 2.5 :

 

… where MYFIELD between ’AHH00091/2017’ and ’AHH00141/2017

 

I would expect 51 records from 91 to 141 all ending with /2017 but

surprisingly, records ending with /2016 or /2015, etc. also appear in the resultset ( so I have to put other criteria e.g. and MYFIELD like '%/2017' )

 

I even added and index on the corresponding field but the result was the same : (

I also tested with Firebird 3 all above tests with the same result : (

 

Is there a size limit (count of relevant characters) on between comparisons? Am I missing something?

 

Thank you.

 

Best regards,

Tamas Kiss