Fixing the export to include the to_date in its range.