Z
zhuifeng
Unregistered / Unconfirmed
GUEST, unregistred user!
有三个edit,用于输入查询条件,前两个edit用语精确查询,最后一个edit用于模糊
查询,可我写的sql.add语句不对,请各位高手指教指教,
if (edit1.text<>'') and (edit2.text<>'') and (edit3.text<>'') then
sql.add('select * from sjswt where wtgddm='+edit1.text+' and wtzqdm='+edit2.text+' and wthtxh like "'+edit3.text+'%"');
if (edit1.text<>'') and (edit2.text<>'') then
sql.add('select * from sjswt where wtgddm='''+edit1.text+''' and wtzqdm='''+edit2.text+'''');
if (edit1.text<>'') and (edit3.text<>'') then
sql.add('select * from sjswt where wtgddm='+edit1.text+' and wthtxh like "'+edit3.text+'%"');
if (edit2.text<>'') and (edit3.text<>'') then
sql.add('select * from sjswt where wtzqdm='+edit1.text+' and wthtxh like "'+edit3.text+'%"');
我的头都被搞大了,可就不知错在什么地方!
查询,可我写的sql.add语句不对,请各位高手指教指教,
if (edit1.text<>'') and (edit2.text<>'') and (edit3.text<>'') then
sql.add('select * from sjswt where wtgddm='+edit1.text+' and wtzqdm='+edit2.text+' and wthtxh like "'+edit3.text+'%"');
if (edit1.text<>'') and (edit2.text<>'') then
sql.add('select * from sjswt where wtgddm='''+edit1.text+''' and wtzqdm='''+edit2.text+'''');
if (edit1.text<>'') and (edit3.text<>'') then
sql.add('select * from sjswt where wtgddm='+edit1.text+' and wthtxh like "'+edit3.text+'%"');
if (edit2.text<>'') and (edit3.text<>'') then
sql.add('select * from sjswt where wtzqdm='+edit1.text+' and wthtxh like "'+edit3.text+'%"');
我的头都被搞大了,可就不知错在什么地方!