比如,我現在要插入一組數據,而在插入數據之前要先查詢日期是否爲空,若爲空,則插入,否則不插入.
qry.close;
qry.clear;
qry.sql.add('select * from up where dt='''+formatdatetime('yyyy/mm/dd',now)+'''and sn='''+edt_sn1.text+'''');
qry.open;
if qry.recordcount>0 then
showmessage('插入')
else
showmessage('不插入');
是這樣嗎?