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