Access
Access 数据库的Date格式字段值必须由一对 # 符号标识,即当Access与日期常量比较的时候,日期常量应由##包围。
举例一:
查找2001-01-01至2001-01-31(即该年一月份)生日的客户资料:
1.Select * From Customer Where BirthDay
Between #2002-01-01# and #2002-01-31#
2.SELECT * FROM Customer WHERE Year(Birthday)=2001 and
month(Birthday)=1 AND
Day(Birthday)>=1 AND Day(Birthday)<=31
3.SELECT * FROM Customer WHERE FORMAT(Birthday,"yymmdd")
BETWEEN "20010101" AND "20010131"
如果放入字符串内,注意双引号要变成单引号,应改为: