select * from table where fDate between '1999-7-1' and '2002-7-1'
我说完整一些:sql server、sybase、db2这些数据库用sql = "select * from table where '" & 起始日期 & "'" &" and & "'" & 终止日期& "'" ,access数据库用 sql = "select * from table where #" & 起始日期 & "#" &" and & "#" & 终止日期& "#"。
应该是: sql server、sybase、db2这些数据库用sql = "select * from table where fDate between '" & 起始日期 & "'" &" and & "'" & 终止日期& "'" ,access数据库用 sql = "select * from table where fDate between #" & 起始日期 & "#" &" and & "#" & 终止日期& "#"。
seletct * from yourtablename where yourdatecol between #1999-07-01 # and #2002-07-01#
sql = "select * from table where fDate between #" & 起始日期 & "#" &" and & "#" & 终止日期& "#"。老是提示:缺少语句结束~~~数据库为ACCESS2000
sql = "select * from table where fDate between #" & 起始日期 & "# and #" & 终止日期 & "#" 你最好把日期格式 成format(日期,"yyyy-mm-dd") 你再试试看,OK
例:select * from table where fDate between '1999-7-1' and '2002-7-1'rsUser.Open "SELECT ID,发报社号,发报社名,收报社号,收报社名,金额,收款社名称,付款单位名称,编报日期,收发状态值 FROM [" & CStr(WorkDate) & "] where 编报日期 between '99-6-1' and '02-7-1'"提示数据类型不匹配~~~~
sql = "select * from table where fDate between #" & 起始日期 & "# and #" & 终止日期 & "#" 你最好把日期格式 成format(日期,"yyyy-mm-dd") 你再试试看,OK rsUser.Open "select * from [" & CStr(WorkDate) & "] where 编报日期 between #" & "99-6-1" & "# and #" & "02-6-1" & "#"成功~~~;D
例:select * from table where fDate between '1999-7-1' and '2002-7-1' rsUser.Open "SELECT ID,发报社号,发报社名,收报社号,收报社名,金额,收款社名称,付款单位名称,编报日期,收发状态值 FROM [" & CStr(WorkDate) & "] where 编报日期 between '99-6-1' and '02-7-1'"提示数据类型不匹配~~~~ ---------------------------------------- 你的fdate 是不是日期格式?是的话直接 select * from table where fdate>date1 and fdate,date2
sql = "select 表名.字段名 from inandout date between" & "#" & 起始日期& "#" & "and" & "#" & 终止日期& "#"
‘date 是表中的字段,
,access数据库用 sql = "select * from table where #" & 起始日期 & "#" &" and & "#" & 终止日期& "#"。
sql server、sybase、db2这些数据库用sql = "select * from table where fDate between '" & 起始日期 & "'" &" and & "'" & 终止日期& "'"
,access数据库用 sql = "select * from table where fDate between #" & 起始日期 & "#" &" and & "#" & 终止日期& "#"。
where yourdatecol between #1999-07-01 # and #2002-07-01#
你最好把日期格式 成format(日期,"yyyy-mm-dd")
你再试试看,OK
你最好把日期格式 成format(日期,"yyyy-mm-dd")
你再试试看,OK
rsUser.Open "select * from [" & CStr(WorkDate) & "] where 编报日期 between #" & "99-6-1" & "# and #" & "02-6-1" & "#"成功~~~;D
rsUser.Open "SELECT ID,发报社号,发报社名,收报社号,收报社名,金额,收款社名称,付款单位名称,编报日期,收发状态值 FROM [" & CStr(WorkDate) & "] where 编报日期 between '99-6-1' and '02-7-1'"提示数据类型不匹配~~~~
----------------------------------------
你的fdate 是不是日期格式?是的话直接
select * from table where fdate>date1 and fdate,date2