## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> MONTHS_BETWEEN[MONTHS_BETWEEN]:::quoted MONTHS_BETWEEN --> End((END)) ``` ## Purpose The `MONTHS_BETWEEN` SQL functions gets the number of months between two dates. The fractional part is determined using a 30-day month length. Parameters: - Date 1: first date. - Date 2: second date. Returns: A decimal with the number of months and fractional part. Negative when date 2 is before date 1. Positive otherwise. Introduced in 17.32