select period_diff(extract(year_month from date1), extract(year_month from date2)) as month_spread from foo;