qry5.Close;
qry5.sql.Clear;
qry5.SQL.Add('insert findreceivezxk');
qry5.sql.Add('(no, finddate,finddate1, spellid, qimo ) select '+inttostr(no0));
qry5.SQl.Add(','''+datetostr(wwDBDateTimePicker3.date)+''','''+datetostr(wwDBDateTimePicker6.date)+''',');
qry5.sql.add('a.spellid,qimo=sum(a.receivesum) ');
qry5.sql.add('from qimoke a where 1=1');
if not(wwDBEdit26.Text='') then
qry5.sql.add('and spellid='''+wwDBLookupComboDlg7.Text+'''');
qry5.sql.add('GROUP BY a.SPELLID order by a.spellid');
qry5.ExecSQL;