请问我下面的SQL与具有什么错误?(40分)

E

esgeht

Unregistered / Unconfirmed
GUEST, unregistred user!
var
year1,month1,day1:word;
begin
decodedate(date+1,year1,month1,day1);
Query1.close;
with Query1 do begin
with SQL do begin
Clear;
Add('select * from data.db');
Add('where type=''公历''');
Add('and month='''+inttostr(month1)+''' and day='''+inttostr(day1)+'''');
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          总是报这一句出错,在数据表中month,day字段都是字符串类型
end;
 
month,day都是保留字吧。
 
month,day是系统函数
 
Add('and [month]='''+inttostr(month1)+''' and [day]='''+inttostr(day1)+'''');
~~ ~~ ~~ ~~
 
系统保留字是不能用在T-SQL中的,换别的吧
 
同意Expert.
 
month ,day 都 是保留字
我曾经被这个问题整整耽误了一天啊
 
接受答案了.
 
顶部