19-03-2009, 10:37 AM
كود :
WITH dm_link.DataModule1.sum_doctyp_group_new DO
// WITH dm_link.DataModule1.SubDoctyp_ADOQuery DO
BEGIN
//---------------------------------------
StrSQL :='select adocTyp, codnam ,sum(ADOCTYP_SUM) ADOCTYP_SUM '
+' from (select distinct c.adocTyp, codnam ,0 ADOCTYP_SUM '
+' from ggrt1040 A, ggrt1050 B, arct1011 c '
+' where c.arcfunc ='+ARCFUNC+ ' and FLDnam =''ADOCTYP'' and A.codtyp = B.codtyp and CodNo = c.adoctyp '
+' union '
+' select distinct c.adocTyp, codnam ,count(d.adoctyp) ADOCTYP_SUM '
+' from ggrt1040 A, ggrt1050 B, arct1011 c ,'+ imageTableName +' d '
+' where c.arcfunc ='+ARCFUNC+ ' and FLDnam = ''ADOCTYP'' '
+' and A.codtyp = B.codtyp and CodNo = c.adoctyp'
+' and c.ARCFUNC=d.ARCFUNC and c.ADOCTYP = d.ADOCTYP and d.ARCSRL='+ ARCSRL
+' having count(d.adoctyp) > 0 '
+' GROUP BY c.adoctyp,codnam ) '
+' group by adocTyp, codnam '
+' order by ADOCTYP_SUM desc,adocTyp, codnam';
Close;
SQL.Clear;
SQL.Add(StrSQL);
// result:=StrSQL;
showmessage( 'currentImage_name');
// Exit;
DBLookupListBox_All.Visible :=False;
DBLookupListBox_All.KeyField :='ADOCTYP';
DBLookupListBox_All.ListField :='CODNAM;ADOCTYP_SUM;ADOCTYP'; //اظهار ثلاث حقول
DBLookupListBox_All.ListSource :=dm_link.DataModule1.ds_sum_doctyp_group_new ;
// DBLookupListBox_All.ListSource :=dm_link.DataModule1.SubDoctyp_Query_DataSource ;
DBLookupListBox_All.Visible :=true;
Open;
END;كود :
Tabel1.First
While Not Tabel1.Eof Do
Begin
Tabel1.Edit;
Tabel1.FieldByName('name').AsString :=' xxxx';
Tabel1.Post;
Tabel1.Next;
End;
Tabel1.Filtered := False;