Hi, all
I have tried to cast to float numbers from string in the database fields to compare with another numbers. The field in the database was String type. I have tried to use BETWEEN criteria using cast() as " cast(field, float) BETWEEN 1.003 AND 100.00)" in the where statement. however, it does not help.
however, when I tried to execute the regular query directly to Database without Hibernate, it works fine as "SELECT * FROM table WHERE cast(field as float) BETWEEN 1.003 AND 100.00"
I have tried ".. WHERE cast(field as float) > 1.003 AND cast(field as float) < 100", however it does not work on Hibernate either.
I found several blogs or forms, but it does not help.
https://forum.hibernate.org/viewtopic.php?p=2399159
Do you have any idea what was wrong or any opinion ?
I will appreciate about that if you give some directions.
Thanks
tiger