Less than or equal to query

See How to use Aggregation? for ideas. This problem is same as finding if my ip address falls withing a range of ip addresses and easily solved using udfs.