Backport Fix issue #22 -- Error in group by clause: only includes the primary key
Backport Fix issue #21 -- missing date_interval_sql implementation