转换一下即可:
sqlserver:
select * from tab
where convert(varchar(10),datecol,120)
between '2013-04-15' and '2013-05-04'
oracle
select * from tabxxx
where to_char(datecol,'yyyy-mm-dd') between '2013-04-15' and '2013-05-04'
奇怪。。为什么要去掉时分秒?
select count(*) from tb_users
where 时间>='2013-05-23'and
时间<'2013-05-24'
这样就ok了啊。。
你的enter_date不是datetime精工的吗,不要转换
SELECT count(*)
from tb_users
where enter_date BETWEEN '2013-05-23' AND '2013-05-24'
直接这样就ok
这样试试 SELECT count(*) from tb_users where enter_date>='2013-05-23' AND enter_date<'2013-05-24'
select * from table where 时间 between and 至于具体到分秒,你可以用format 函数