I was trying to use the formula DATEDIFF(month,date1,date2) to calculate the months between two dates based on the function details that shows up in Magic ETL (which I have pasted below).
In the Unit form, the difference is returned in the specified units from the first argument until the second. For example, DATEDIFF(day, '2011-01-01', '2011-01-08') returns 7. Timestamp and string arguments are converted to dates when the unit requires it (day, month, year, etc.), while date and string arguments are converted to timestamps for other units (second, minute, hour, etc.). This form is largely compatible with other SQL dialects, excluding MySQL.
The formula seems to work when I enter some random dates and validate the tile
DATEDIFF (MONTH, '2020-02-08', '2024-02-09') (It shows 48 when I validate my formula).
However when I run preview for the ETL I am getting an error "Column referenced but not found: MONTH"
Any idea why this is happening and how to fix it?
Thanks in advance.