Frame test for left and right join with nearest smaller or greater option