DATETRUNC returns DATETIME
Closed this issue · 1 comments
hawkfish commented
Figured it out. DuckDB rebinds the return type for day-level truncations to DATE
, but Tableau expects the return type to always be DATETIME
, so it butchers the return type back to date time and messes it up depending on the system TZ. This is why adding the cast fixes the problem - the values are returned with the type Tableau expects and it leaves them alone.
This is not a DuckDB bug, but it is something I can fix in the duckdb-taco. if you are using PG dialect, then you will need to add the cast manually.
Originally posted by @hawkfish in duckdb/duckdb#7879 (comment)
hawkfish commented
Repro steps:
- Set the system time zone to CET (Oslo)
- Open the attached workbook
Expected: Dates are the first of the month
Actual: Dates are the last of the previous month