select * from rechargetable
where Format (CurTime, 'Short Date') between #12/31/2014#
and #01/02/2015# and Channel = 'Channel15'
order by autono desc
和
select * from rechargetable
where Format (CurTime, 'Short Date')>=#12/31/2014#
and Format (CurTime, 'Short Date')<=#01/02/2015# and Channel = 'Channel15'
order by autono desc
它显示了数据库中的所有记录,如果在2014年12月30日到2014年12月31日之间搜索,它可以正常工作
答案 0 :(得分:0)
格式将任何值更改为字符串,因此您要比较两个字符串。考虑DateValue
SELECT * FROM rechargetable
WHERE DateValue(CurTime) Between #2014/12/31# And #2015/01/02#
AND Channel = 'Channel15'
ORDER BY autono Desc