SELECT MAX(sf_time2) AS sf_time2 FROM (SELECT MAX(sf_time1) AS sf_time1, sf_time2 FROM Zd_Sf GROUP BY sf_time2)如题,这句嵌套在SQL中没问题,一放到VB中就提示“)附近有错误”不知错误在哪里请哪位大哥指点一下谢谢
strsql="SELECT MAX(sf_time2) AS sf_time2 FROM (SELECT MAX(sf_time1) AS sf_time1, sf_time2 FROM Zd_Sf GROUP BY sf_time2)"
dim Str as String dim Conn as adodbc.connectiong dim Rs as adodbc.recordset Str="SELECT MAX(sf_time2) AS sf_time2 FROM (SELECT MAX(sf_time1) AS sf_time1, sf_time2 FROM Zd_Sf GROUP BY sf_time2)" Conn.open 你数据库的连接字符串 set Rs=Conn.excute(Str)
SELECT MAX(sf_time2) AS sf_time2 FROM (SELECT MAX(sf_time1) AS sf_time1, sf_time2 FROM Zd_Sf GROUP BY sf_time2) as tmp
SELECT MAX(sf_time2) AS sf_time2 FROM (SELECT MAX(sf_time1) AS sf_time1, sf_time2 FROM Zd_Sf GROUP BY sf_time2) as tmp
dim Conn as adodbc.connectiong
dim Rs as adodbc.recordset
Str="SELECT MAX(sf_time2) AS sf_time2 FROM (SELECT MAX(sf_time1) AS sf_time1, sf_time2 FROM Zd_Sf GROUP BY sf_time2)"
Conn.open 你数据库的连接字符串
set Rs=Conn.excute(Str)