Error while searching the previous and the next float from database