Field Filter working unexpected and returns partial data when applied

HI, I have created a SQl question and have used field filter in the same.
While the filter works, but it retrives partial data.
PFA screen captures below with the description. Need an assistance on the same to solve this issue.

Date Range field filter returns nothing when selected Yesterdays date.
While without filter it shows yesterdays data.

(Providing images in subsequent comment as it’s not letting me upload more than one image)


Even Relative Date field filter returns nothing when selected yesterday date.


Relative Date field filter retrieves data without previous (latest) 2 days data when applied Past 7 days in the filter.

Without filter it fetches the records which show records present for last 2 days.

You’re not comparing the filter values to anything.
Shouldn’t you be comparing the filter to a column in the database.
Your SQL is just returning:
AND ‘2018-02-07’
instead of
AND table.columnName = ‘2018-02-07’

Unless there’s some weird SQL syntax here.

This smells like a timezone bug, or perhaps related to the issue where we’re incorrectly appending a time value to dates that don’t have one (I’m seeing a lot of 12:00 AM in your dates).

1 Like

You’re not comparing the filter values to anything.
Shouldn’t you be comparing the filter to a column in the database.
Your SQL is just returning:
AND '2018-02-07’
instead of
AND table.columnName = ‘2018-02-07’

Unless there’s some weird SQL syntax here.

This syntax is correct when using Metabase’s field filters. That syntax is actually inserting a whole SQL clause, rather than just a single value. That’s what enables things like date range filters, or category value dropdown filters. See here:

@maz The field filter (date range) is mapped to ‘creation_date’ whose data type is timestamp in my database (mysql). Is this the issue? Any solution for this?