Skip to content

Returns the number of months between two dates.

func.months_diff(<end_date>, <start_date>)
func.months_diff('2024-06-01', '2024-01-01')
┌───┐
5
└───┘
MONTHS_DIFF(<end_date>, <start_date>)
SELECT MONTHS_DIFF('2024-06-01', '2024-01-01');
┌───┐
5
└───┘