Date Field Filter Producing Incorrect Values

Hi there,

There seems to be an issue with the parameters that Metabase is using for the date field filters.

I have a SQL statement in Metabase that performs a simple count constrained by date. Performing this without a date field filter I can see the total of the count is 9,741:

Applying the date range field filter yields a lower incorrect number:

And applying the year/month filter yields a higher incorrect number:

In my snowflake instance I can see that metabase is passing the exact same SQL statement as the first correct statement however, it seems the parameters it's passing in for dates (the question marks) are causing the resulting number to be incorrect.

Can you share diagnostic info?

Also what is the reporting timezone you have setup in Admin -> Localization

Sure, timezone is set to 'database default' (though the same result happens when set to 'Europe/London').

Diagnostic info:

{
  "browser-info": {
    "language": "en-GB",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.15+10",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.15",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.15+10",
    "os.name": "Linux",
    "os.version": "5.10.164.1-1.cm1",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "snowflake",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "14.6"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.3.2"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2022-06-13",
      "tag": "v1.43.3",
      "branch": "release-x.43.x",
      "hash": "c9c7ef0"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Are you able to upgrade to 1.46.4? Since you are in an old release and to investigate i have to deploy a very old version

No problem, we have upgraded to 1.46.4:

{
"browser-info": {
"language": "en-GB",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.19+7",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.19",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.19+7",
"os.name": "Linux",
"os.version": "5.10.164.1-1.cm1",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"h2",
"snowflake"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "14.7"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.5.1"
}
},
"run-mode": "prod",
"version": {
"date": "2023-05-24",
"tag": "v1.46.4",
"branch": "release-x.46.x",
"hash": "f858476"
},
"settings": {
"report-timezone": null
}
}
}

You are getting the same issue even after upgrade?

Hi Tony, yes we are still seeing the same issue with the date filter.