Team -
I'm trying to use the in database formula tool to calculate the Average difference between two dates. I would think it would be a DateDiff formula but that constantly errors.
Example: DateDiff(days, "Latest_Date", "Early_Date",)
Everything I try error's.....
Suggestions?
Ryan
Hi there,
First, each database system has its own set of functions and syntax rules. While the core concept of calculating date differences remains the same, the implementation (how to write the SQL) vary.
Your syntax seems to match SQL server.
DATEDIFF(day, [Early_Date], [Latest_Date])
For Snowflake though, you'd need:
DateDiff('days', [Latest_Date], [Early_Date])
...and for MySQL, you'd use....
DATEDIFF([Latest_Date], [Early_Date])
Thanks Lindon - appreciate the response. We were able to get a portion working, but we are still stuck on one thing - I may have a follow up tmrw if you don't mind. Best regards - Ryan
Sure happy to help if something else comes up!