Fixed date handling in 'build_aggregate_stmt' function [t_k,t_k+1), using 'not less than' instead of greater than or equal to for from/to and less than or equal to for 'delivery_date'.