When writing SQL statements that query by time period, we generally write the query conditions as follows:
Where date> = '2014-01-01 'and date <= '2014-10-1 '.
However, some SQL statements are converted into the following:
Where date> = '2014-01-01 0:00:00 'and date <= '2014-10-1: 0: 00: 00'. If you look at this condition again, you may understand,
That is, the data after '2017-10-1 0:00:00 'cannot be found, for example ('2017-10-1: 08: 25: 00'), that is, the data of cannot be found.
If you know the reason, you can modify the query condition:
Where date> = '2014-01-01 'and date <= '2014-10-1 23:59:59' or where date> = '2014-01-01 'and date <= '2014-10-2'.
When writing SQL statements that query by time period, we generally write the query conditions as follows:
Where date> = '2014-01-01 'and date <= '2014-10-1 '.
However, some SQL statements are converted into the following:
Where date> = '2014-01-01 0:00:00 'and date <= '2014-10-1: 0: 00: 00'. If you look at this condition again, you may understand,
That is, the data after '2017-10-1 0:00:00 'cannot be found, for example ('2017-10-1: 08: 25: 00'), that is, the data of cannot be found.
If you know the reason, you can modify the query condition:
Where date> = '2014-01-01 'and date <= '2014-10-1 23:59:59' or where date> = '2014-01-01 'and date <= '2014-10-2'.