MONTHS_DIFF (Lakehouse v2)
Returns the number of months between two dates.
Analyze Syntax
Section titled “Analyze Syntax”func.months_diff(<end_date>, <start_date>)Analyze Examples
Section titled “Analyze Examples”func.months_diff('2024-06-01', '2024-01-01')
┌───┐│ 5 │└───┘SQL Syntax
Section titled “SQL Syntax”MONTHS_DIFF(<end_date>, <start_date>)SQL Examples
Section titled “SQL Examples”SELECT MONTHS_DIFF('2024-06-01', '2024-01-01');
┌───┐│ 5 │└───┘