insert into not EXISTS 问题(delphi)

procedure TForm1.SpeedButton3Click(Sender: TObject); var i:Integer; s,time1,time2:TTime; strsql:string; begin time1:=strtotime(time1.text); time2:=strtotime(time2.Text); s:=time2-time1; strsql:='insert into tijiao(姓名,錄入日期,加班時間,加班工時) select %s,%s,%s,%s from tijiao WHERE NOT EXISTS(SELECT 姓名 FROM tijiao where 錄入日期=%s)'; for i:=0 to chklst1.Items.Count -1 do if chklst1.Checked[i]=true then with dm.qry2 do begin Close; SQL.Clear; SQL.Add(format(strsql,[QuotedStr(chklst1.Items[i]),'"'+formatdatetime('yyyy-mm-dd',now)+'"',QuotedStr(edt.Text+'-'+edt11.text),QuotedStr(floatToStr(s*24)),'"'+formatdatetime('yyyy-mm-dd',now)+'"'])); ExecSQL; end; end; 我是想批量插入多条checklistbox的数据..发现有录入日期重复的不插入 可是我上面的代码点击之后没有任何反应,没有错误,也没有插入

'insert into tijiao(姓名,錄入日期,加班時間,加班工時) select %s,%s,%s,%s from tijiao WHERE NOT EXISTS(SELECT 姓名 FROM tijiao where 錄入日期=%s)'; NOT EXISTS 改为 not in 吧 还有就是 tijiao里面的列必须和select出来的结果列是一致,(主键自增的除外),否则也不能insert 成功
温馨提示:答案为网友推荐,仅供参考