### Describe the bug
If I use the date filter mode "After" for the first day in… the month I get what looks like the data I expect. However if I use "Between" with the same start date I'm getting records from the day before the start of that month. I've only seen this in data from our MSSQL data sources.
This is likely timezone related, we're at GMT+12/13 which has confused Metabase before, but what I don't understand is why it's inconsistent.
Using "After":
![image](https://user-images.githubusercontent.com/4504437/235387387-f669c1a9-ceaf-4af8-a465-c7e853a5e63d.png)
Using "Between:
![image](https://user-images.githubusercontent.com/4504437/235387406-3067acce-0f0a-4781-b926-2ffdf0ef4a7f.png)
Note that the second image above includes a count from June.
Regardless of which filter mode I use above, clicking on the "View these XXX" from clicking on the July count bar takes me to this screen which includes the single record from June.
![image](https://user-images.githubusercontent.com/4504437/235387548-2a189771-e8db-49df-9b60-a6ae1c01d2be.png)
### To Reproduce
I don't have a good repro on the sample database as I think this may be an MS SQL Server specific issue. For a SQL Server connection this is a repro ...
1. Ensure you have data within the GMT offset hours prior to the start of a month e.g. 30 June, 23:00 if filter date will be 1 July.
2. Create a question counting rows per month using the between filter starting on the first day of the month used above, e.g. 1 July
3. You'll get at least one count reported in June
### Expected behavior
Date filters should be consistent and correctly applied.
### Logs
Nothing in the logs but these are the generated SQL queries (redacted, only relevant date specific parts)
Using After:
```sql
SELECT DateFromParts(year("xxx"."xxx"."DateReceived"), month("xxx"."xxx"."DateReceived"), 1) AS "DateReceived", count(*) AS "count"
FROM "xxx"."xxx"
LEFT JOIN "yyy"."yyy"
WHERE (qqq
AND "xxx"."xxx"."DateReceived" >= DateTimeOffsetFromParts(2022, 7, 2, 0, 0, 0, 0, 12, 0, 7))
GROUP BY year("xxx"."xxx"."DateReceived"), month("xxx"."xxx"."DateReceived")
ORDER BY year("xxx"."xxx"."DateReceived") ASC, month("xxx"."xxx"."DateReceived") ASC
```
Using "Between":
```sql
SELECT DateFromParts(year("xxx"."xxx"."DateReceived"), month("xxx"."xxx"."DateReceived"), 1) AS "DateReceived", count(*) AS "count"
FROM "xxx"."xxx"
LEFT JOIN "yyy"."yyy"
WHERE (qqq
AND "xxx"."xxx"."DateReceived" >= DateTimeOffsetFromParts(2022, 7, 1, 0, 0, 0, 0, 12, 0, 7) AND "xxx"."xxx"."DateReceived" < DateTimeOffsetFromParts(2023, 5, 2, 0, 0, 0, 0, 12, 0, 7))
GROUP BY year("xxx"."xxx"."DateReceived"), month("xxx"."xxx"."DateReceived")
ORDER BY year("xxx"."xxx"."DateReceived") ASC, month("xxx"."xxx"."DateReceived") ASC
```
And for the drill through detail table:
```sql
SELECT TOP 1048575 "xxx"."xxx"."DateReceived" AS "DateReceived"
FROM "xxx"."xxx"
WHERE (qqq
AND "xxx"."xxx"."DateReceived" >= DateTimeOffsetFromParts(2022, 7, 1, 0, 0, 0, 0, 12, 0, 7) AND "xxx"."xxx"."DateReceived" < DateTimeOffsetFromParts(2022, 8, 1, 0, 0, 0, 0, 12, 0, 7))
```
You can see these use a mixture of `DateTimeOffsetFromParts(2022, 7, 1, 0, 0, 0, 0, 12, 0, 7)` and `DateTimeOffsetFromParts(2022, 7, 2, 0, 0, 0, 0, 12, 0, 7)`.
### Information about your Metabase installation
```JSON
{
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0",
"vendor": ""
},
"system-info": {
"file.encoding": "Cp1252",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "17.0.2+8",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "17.0.2",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "17.0.2+8",
"os.name": "Windows Server 2012 R2",
"os.version": "6.3",
"user.language": "en",
"user.timezone": "Pacific/Auckland"
},
"metabase-info": {
"databases": [
"sqlserver",
"postgres",
"h2"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "10.5"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.5.0"
}
},
"run-mode": "prod",
"version": {
"date": "2023-02-19",
"tag": "v0.45.3",
"branch": "release-x.45.x",
"hash": "070f57b"
},
"settings": {
"report-timezone": "Pacific/Auckland"
}
}
}
```
### Severity
This is blocking some users or causing them to have to double check data. It's giving inconsistent data, sometimes applying filters incorrectly.
### Additional context
This may be a regression but I can't find specific issues relating to this.