To gain a bit of a speed increase, you could convert the dates to integer values, as an offset from some base date that all other dates will be after. Choose something like january 1, 1800, or whatever base date is appropriate to your application. The conversion to an offset can be handled by the Date::Calc function Delta_Days(), getting the delta days from the base date to the desired date. Then all of your comparisons can go a little quicker, being integer comparisons, vs date comparisons or whatever.