I have a SQL query with two WHERE clause versions:

First (Explicit timestamps):

```
WHERE created_at BETWEEN '2017-07-06 00:00:00.0' AND '2017-07-20 00:00:00.0' AND doc->>'sensorId' != '7777777'

```

Resulting row count = 15477

Second (Cast as Dates):

```
WHERE created_at::date BETWEEN '2017-07-06'::date AND '2017-07-20'::date AND doc->>'sensorId' != '7777777'

```

Resulting row count = 18679

The created\_at column contains timestamps with no timezone in the form of '2017-07-06 08:41:34.574686' 

The length of the milliseconds differs between 5 and 6 digits.

I realize this is likely created by casting the timestamp as a date, but I have no understanding of why this happens, if someone could please explain.