Sqlglot is switching date_trunc to timestamp_trunc upon parsing, which is not a valid Snowflake sql function. It is also switching the argument order and unquoting the date part where it shouldn't do ...
Use a CTE that returns the row ID and the result of the DateDiff, then join that to your existing result set? It may or may not be faster, so as always, test it to see.
I skipped the first few questions, since I think they might not be important to this issue. What did you do? I tested the example code for the datediff function. Parameters: part – The time part to ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results