We should standardize the date_trunc() function, making it available for use to all Dialects. HSQLDB supports a trunc() function similar to Oracle and DB2. Microsoft SQL Server supports a datetrunc() function since version 16. Dialects that don't have a viable native function can use an emulation that leverages formatting the datetime to string and parsing back after truncating to the correct Temporal Unit. Also, fix the use of the function trunc() in Oracle and DB2 that requires transforming the Temporal Unit into a different format for most cases. |