Access时间查询
--1 我想查询出所有从2004年11月4日到2005年1月3日的数据,如何查询?
select * from tablename where format(DateField,"yyyy-mm-dd") between "2004-11-04" and "2005-01-03"
--2 还有如何查询出所有为2004-4-4日的数据呢?
select * from tablename where format(DateField,"yyyy-mm-dd" )="2004-04-04"
--3 如何查询出所有2004年4月的数据呢?
select * from tablename where format(DateField,"yyyy-mm" )="2004-04"
select * from tablename where format(DateField,"yyyy-mm-dd") between "2004-11-04" and "2005-01-03"
--2 还有如何查询出所有为2004-4-4日的数据呢?
select * from tablename where format(DateField,"yyyy-mm-dd" )="2004-04-04"
--3 如何查询出所有2004年4月的数据呢?
select * from tablename where format(DateField,"yyyy-mm" )="2004-04"