with qryht do
begin
close;
commandtext:=' insert into dye_pricemain(guid,startdate,enddate,pmonth,createname,createdate) '
+' select guid,startdate,enddate,stockmonth,operator,operatordate from dye_stockmain '
+' where not exists(select pmonth from dye_pricemain) and stockmonth='+sysutils.QuotedStr(stockmonth);