between '2018-01-01 00:00:00:000' and '2018-12-31 00:00:00:000'
in your query but it makes it error prone if your datetime isnt as accurate in milliseconds as you shown. You should better use for example:
(Your predicate) >= 2018-01-01 and < 2018-12-31
and this will guaranty that it will only take all the rows from the start and only the rows till the end.
So always use an open-ended range to prevent erroneously including or excluding rows. It’s much less complex to find the beginning of the next period than the end of the current period.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You explicitly used
between '2018-01-01 00:00:00:000' and '2018-12-31 00:00:00:000'
in your query but it makes it error prone if your datetime isnt as accurate in milliseconds as you shown. You should better use for example:
(Your predicate) >= 2018-01-01 and < 2018-12-31
and this will guaranty that it will only take all the rows from the start and only the rows till the end.
So always use an open-ended range to prevent erroneously including or excluding rows. It’s much less complex to find the beginning of the next period than the end of the current period.