"Select * from 表名 WHERE II='59' and " & Format(tT, "yyyyMMdd") & " =20040823 ORDER BY tT DESC" 运行这句时出现tTime”变量未定义“的错误, tTime字段内容如”04-08-23 06:04:00 上午“。 请问该如何写啊?????
Sql语句的问题
"Select * from 表名 WHERE II='59' and " & Format(tT, "yyyyMMdd") & " =20040823 ORDER BY tT DESC"
什么数据,初步判断是access
改成
"Select * from 表名 WHERE II='59' and Format(tT, " & chr(34) & "yyyyMMdd" & chr(34) & ") = '20040823' ORDER BY tT DESC"
试试