"select * From Table1 where date1>'" & BeginDate.Value & "'and date1<'" & EndDate.Value & "' "
select * from table1 where date1 between #2003-4-21# and #2003-5-21#
'数据库为access: strsql="select * from table1 where date1 between # 2003-4-21 # and # 2003-5-21 # " '数据为为sql: strsql="select * from table1 where date1 between '2003-4-21' and '2003-5-21'"
strsql="select * from table1 where date1 between #4-21-2003# and #5-21-2003#"请注意年,月日的顺序,在SQL诘句中要按照这样的顺序写,要不然要出错,在SQL中,#号是用于时间格式的, '' 号是用于字符串格式的.
strsql="select * from table1 where date1 between # 2003-4-21 # and # 2003-5-21 # "
'数据为为sql:
strsql="select * from table1 where date1 between '2003-4-21' and '2003-5-21'"
strsql="select * from table1 where date1 between #4-21-2003# and #5-21-2003#"请注意年,月日的顺序,在SQL诘句中要按照这样的顺序写,要不然要出错,在SQL中,#号是用于时间格式的, '' 号是用于字符串格式的.