v.23.10Improvement
Functions addDate and subDate Support String-Encoded Date Arguments for Enhanced MySQL Compatibility
Functions(add|sub)Datenow support string-encoded date arguments, e.g.SELECT addDate('2023-10-22 11:12:13', INTERVAL 5 MINUTE). The same support for string-encoded date arguments is added to the plus and minus operators, e.g.SELECT '2023-10-23' + INTERVAL 1 DAY. This increases compatibility with MySQL and is needed by Tableau Online. #55960 (Robert Schulze).
Why it matters
This feature improves compatibility with MySQL by allowing date and datetime values to be passed as strings directly to date arithmetic functions and operators. It also facilitates integration with tools like Tableau Online, which rely on this functionality.How to use it
Users can now pass date or datetime arguments as strings in functions such asaddDate and subDate, for example: SELECT addDate('2023-10-22 11:12:13', INTERVAL 5 MINUTE). Similarly, they can use string-encoded dates with plus and minus operators: SELECT '2023-10-23' + INTERVAL 1 DAY.