Time data type to use between ... and .. statement should pay attention to the condition of inquiries

Most projects, we use all the time accuracy to what number, when not treated, stored in the database, the time to the millisecond accuracy on. For example, typing '2013-12-30', but saved in the database becomes '2013-12-30 00: 00: 00.000'. When usually used between ..and .. statement, the numerical data for the two types are included, such as select * from table where number between 1 and 10, 1 and 10 included in the results. But with the actual understand a little different between ..and .. statement when used on time type data. If I want to check 2013-12-30 to 2013-12-31 two days of data, presumably with the BETWEEN
 '2013-12-30' and '2013-12-31' is supposed to be able to get this desired result, but the result is this:

2013-12-30 only found the day's data. DESCRIPTION between '2013-12-30' and '2013-12-31' action period is '2013-12-3000: 00: 00.000' to '2013-12-3100: 00: 00.000' (inclusive) between. Well, next time pay attention.

Guess you like

Origin www.cnblogs.com/cainiaoputeng/p/12103572.html