SELECt A.JSBJ AS 及时报进 FROM (SELECt COUNT(TD) AS JSBJ FROM KANZHE) AS A LEFT JOIN
JINDU AS B ON A.TD=B.TD
这个怎么也不对啊
应该怎么该啊
SELECt A.JSBJ AS 及时报进 FROM (SELECt COUNT(TD) AS JSBJ FROM KANZHE) AS A LEFT JOIN
JINDU AS B ON A.TD=B.TD
这个怎么也不对啊
应该怎么该啊
表A中没有字段TD,应该换成JSBJ
试试下面的语句看看
SELECt A.JSBJ AS 及时报进 FROM (SELECt COUNT(TD) AS JSBJ FROM KANZHE) AS A LEFT JOIN
JINDU AS B ON A.JSBJ=B.TD
JSBJ 与TD不是相同的字段,而且既然是“及时报进”,就应该有个时间性,下面的语句可作个参考:
SELECt COUNT(A.TD) AS 及时报进 FROM KANZHE AS A,JINDU AS B WHERe A.TD=B.TD and datediff(dd,b.sj,'[开始日期(时间)]')<=0 and datediff(dd,b.sj,'[结束日期(时间)]')>=0
或
select count(a.td) as 及时报进 from jindu as b left jion kanzhe as a on b td=a.td where datediff(dd,b.sj,'[开始日期(时间)]')<=0 and datediff(dd,b.sj,'[结束日期(时间)]')>=0
提示什么错误啊?汗