'rq 是数据库里的一个日期字段
’我想拿名字="张三" 和日期=2004年12月的一条记录。
’我写了下面一句,出错。
'请高手办我看看
chkdate="200412"
select * from testdbf where name = "张三" and left(str(rq),6) = '" & chkdate & "' "
’我想拿名字="张三" 和日期=2004年12月的一条记录。
’我写了下面一句,出错。
'请高手办我看看
chkdate="200412"
select * from testdbf where name = "张三" and left(str(rq),6) = '" & chkdate & "' "
chkdate = #12/1/2004# "select * from testdbf where name = 'ÕÅÈý' and fomat(rq,'yyyy-mm') = #" & Format(chkdate, "yyyy-mm") & "#"
chkdate = #12/1/2004# "select * from testdbf where name = '张三' and fomat(rq,'yyyy-mm') = #" & Format(chkdate, "yyyy-mm") & "#"
"select * from testDbf where name = '张三' and left(convert(varchar(10),rq,112),6) = '200412'"
我觉的用 convert 函数比较好