求DELPHI强人帮我看看这句SQL语句

来源:百度知道 编辑:UC知道 时间:2024/06/23 14:59:16
'update timecard set '''+dd+'''=''√'',wid='i',kmonth='month' where username='''+sql+''' and truename='''+tn+'''';

我这句SQL语句引号引的不对,可是我找不出来在哪,帮我看看好吗,一遇到引号我头就大
i和month是数值型的

中间的 i 和 Month 也要用两个单引号呀。

'update timecard set '''+dd+'''=''√'',wid=''i'',kmonth=''month'' where username='''+sql+''' and truename='''+tn+'''';

补充:
建议以后用 QuotedStr() 函数,把字符串加上引号。 ' update timecard set '+QuotedStr(dd)+'=''√'',wid=''i'',kmonth=''month'' where username='+QuotedStr(sql)+' and truename='+QuotedStr(tn)+' ';