我有字段Booking_DateTime
,其中我们有2015-09-07 16:00:47
现在的问题是,我想要今天的报告,查询将是
select * from table where Booking_DateTime = 2015-09-07
但是它没有显示任何数据,因为我有日期和时间。现在我该怎么做呢
试试DATE
。
select * from table where DATE(Booking_DateTime) = '2015-09-07'
或者如果你需要当前日期,你不必手动设置。-
select * from table where DATE(Booking_DateTime) = CURDATE()