Custom question casts date to weeks and months during join

Describe the bug

Calendar dates are cast to month when joining in Custom questions

To Reproduce

  1. Generate the calendar view:
    CREATE VIEW playground.lot_calendar AS
    SELECT '2014-12-01' + 1 AS calendar_date
    UNION ALL
    SELECT '2014-12-01' + 2 AS calendar_date
    UNION ALL
    SELECT '2014-12-01' + 3 AS calendar_date
    UNION ALL
    SELECT '2014-12-01' + 4 AS calendar_date
    ;

  2. Ask a question > Custom question > use view (lot_calendar) as 'Data' and join itself (lot_calendar) on calendar_date (see screenshot for generated SQL)

  1. The join is on calendar_date month truncated

Expected behaviour

Joining on calendar_date (not truncated) instead of calendar_date month truncated

We're running Metabase version 0.38.2

Hi @lvdv
You're seeing this issue:
https://github.com/metabase/metabase/issues/10924 - upvote by clicking :+1: on the first post

1 Like