P
poim111
Unregistered / Unconfirmed
GUEST, unregistred user!
COUNT_QUERY.Close; <br> COUNT_QUERY.SQL.Text:='SELECT TZNAME_TABLE.PROJECTNUMBER as 编码,TZNAME_TABLE.PROJECTFATHER AS 父编码, '<br> +'TZdate_TABLE.WORKGS AS 概算工作量,TZdate_TABLE.WORKYS AS 预算工作量,TZdate_TABLE.TZWORKS AS 调整工作量,TZdate_TABLE.CWWORKS AS 财务决算工作量,'<br> +'TZdate_TABLE.ADDCOUNT AS 累计工作量,TZdate_TABLE.OFYEAR AS 年份 FROM TZDATE_TABLE INNER JOIN TZNAME_TABLE '<br> +'ON TZDATE_TABLE.PROJECTNUMBER = TZNAME_TABLE.PROJECTNUMBER order by TZNAME_TABLE.projectnumber DESC';<br> COUNT_QUERY.Open;<br> COUNT_QUERY.First;<br> while not COUNT_QUERY.Eof do<br> begin<br> COUNT_QUERY.Edit;<br> //概算工作量<br> ADOQuery1.Close;<br> ADOQuery1.SQL.Text:='select sum(WORKGS) as 概算工作量 from TZDATE_TABLE INNER JOIN TZNAME_TABLE '<br> +'ON TZDATE_TABLE.PROJECTNUMBER = TZNAME_TABLE.PROJECTNUMBER where TZNAME_TABLE.projectfather='+#39+COUNT_QUERY.fieldbyname('编码').AsVariant+#39+' and ofyear='+COUNT_QUERY.fieldbyname('年份').AsString;<br> ADOQuery1.Open;<br> if ADOQuery1.FieldByName('概算工作量').AsInteger<>0 then<br> begin<br> COUNT_QUERY.FieldByName('概算工作量').AsVariant:=ADOQuery1.FieldByName('概算工作量').AsVariant;<br> end;<br> //预算工作量<br> ADOQuery1.Close;<br> ADOQuery1.SQL.Text:='select sum(WORKYS) as 预算工作量 from TZDATE_TABLE INNER JOIN TZNAME_TABLE '<br> +'ON TZDATE_TABLE.PROJECTNUMBER = TzNAME_TABLE.PROJECTNUMBER where projectfather='+#39+COUNT_QUERY.fieldbyname('编码').AsVariant+#39+' and ofyear='+COUNT_QUERY.fieldbyname('年份').AsString;<br> ADOQuery1.Open;<br> if ADOQuery1.FieldByName('预算工作量').AsInteger<>0 then<br> begin<br> COUNT_QUERY.FieldByName('预算工作量').AsVariant:=ADOQuery1.FieldByName('预算工作量').AsVariant;<br> end;<br> //调整工作量<br> ADOQuery1.Close;<br> ADOQuery1.SQL.Text:='select sum(TZWORKS) as 调整工作量 from TZDATE_TABLE INNER JOIN TZName_TABLE '<br> +'ON TZDATE_TABLE.PROJECTNUMBER = TZName_TABLE.PROJECTNUMBER where projectfather='+#39+COUNT_QUERY.fieldbyname('编码').AsVariant+#39+' and ofyear='+COUNT_QUERY.fieldbyname('年份').AsString;<br> ADOQuery1.Open;<br> if ADOQuery1.FieldByName('调整工作量').AsInteger<>0 then<br> begin<br> COUNT_QUERY.FieldByName('调整工作量').AsVariant:=ADOQuery1.FieldByName('调整工作量').AsVariant;<br> end;<br> //财务工作量<br> ADOQuery1.Close;<br> ADOQuery1.SQL.Text:='select sum(CWWORKS) as 财务工作量 from TZDATE_TABLE INNER JOIN TZName_TABLE '<br> +'ON TZDATE_TABLE.PROJECTNUMBER = TZName_TABLE.PROJECTNUMBER where projectfather='+#39+COUNT_QUERY.fieldbyname('编码').AsVariant+#39+' and ofyear='+COUNT_QUERY.fieldbyname('年份').AsString;<br> ADOQuery1.Open;<br> if ADOQuery1.FieldByName('财务工作量').AsInteger<>0 then<br> begin<br> COUNT_QUERY.FieldByName('财务决算工作量').AsVariant:=ADOQuery1.FieldByName('财务工作量').AsVariant;<br> end;<br> //累计工作量<br> ADOQuery1.Close;<br> ADOQuery1.SQL.Text:='select sum(CWWORKS) as 累计工作量 from TZDATE_TABLE INNER JOIN TZName_TABLE '<br> +'ON TZDATE_TABLE.PROJECTNUMBER = TZName_TABLE.PROJECTNUMBER where TZName_TABLE.projectnumber='+#39+COUNT_QUERY.fieldbyname('编码').AsVariant+#39+' and ofyear<='+COUNT_QUERY.fieldbyname('年份').AsString;<br> ADOQuery1.Open;<br> if ADOQuery1.FieldByName('累计工作量').AsInteger<>0 then<br> begin<br> COUNT_QUERY.FieldByName('累计工作量').AsVariant:=ADOQuery1.FieldByName('累计工作量').AsVariant;<br> end;<br> COUNT_QUERY.Post;<br> COUNT_QUERY.Next;<br> end;<br>错误提示:缺少更新或刷新的键列信息!<br>主键是有的,就算没有主键我这个得到的绝对也是唯一的数据结果集!<br>本人刚学检查了半天了找不到问题啊!还请大侠们指点一、二啊!