下列语句中,s3为一个字符,要查询日期的五个字符和s3字符相同。但 日期的数据类型是日期型的,
请问该怎么写呀?(日期中的月)
s3:=datetostr(date);
s3:=copy(s3,5,3);
s3:=copy(s3,2,1);
query1.SQL.Add('select 编号 from 出件登记表 where 地区=:s and 日期 like'_s3''); //得出当地区的编号
错误提示:
[Error] Unit1.pas(141): ')' expected but identifier '_s3' found
请问该怎么写呀?(日期中的月)
s3:=datetostr(date);
s3:=copy(s3,5,3);
s3:=copy(s3,2,1);
query1.SQL.Add('select 编号 from 出件登记表 where 地区=:s and 日期 like'_s3''); //得出当地区的编号
错误提示:
[Error] Unit1.pas(141): ')' expected but identifier '_s3' found
这样试试
应该是这样的
query1.SQL.Add('select 编号 from 出件登记表 where 地区=:s and 日期 like '''+_s3+'%''');
Sql2000的convert函数