Perhaps the following link might help you http://datapigtechnologies.com/blog/...ranges-part-1/

It seems to be doing what you want, or close to it