各位大哥,小弟现在练习的程序有个功能是查询某一时间段内的数据,同样的
一句语句select * from attendance where io_time>'2002-11-01' and io_time<'2002-12-04'
在SQL SERVER查询分析器里执行能找到符合条件的记录,而在
with DM_main.query1 do
begin
close;
sql.clear;
sql.add('select * from attendance where io_time>'2002-11-01' and io_time<'2002-12-04'');
prepare;
open;
end;
里,执行时,却提示
Error] u_attendance.pas(307): Missing operator or semicolon
[Error] u_attendance.pas(307): Missing operator or semicolon
[Error] u_attendance.pas(307): Incompatible types: 'String' and 'Integer'
[Fatal Error] attendance.dpr(11): Could not compile used unit 'u_attendance.pas'
307行是sql.add('select * from attendance where io_time>'2002-11-01' and io_time<'2002-12-04'');io_time是datetime型的
请问是什么原因?
谢谢了!
一句语句select * from attendance where io_time>'2002-11-01' and io_time<'2002-12-04'
在SQL SERVER查询分析器里执行能找到符合条件的记录,而在
with DM_main.query1 do
begin
close;
sql.clear;
sql.add('select * from attendance where io_time>'2002-11-01' and io_time<'2002-12-04'');
prepare;
open;
end;
里,执行时,却提示
Error] u_attendance.pas(307): Missing operator or semicolon
[Error] u_attendance.pas(307): Missing operator or semicolon
[Error] u_attendance.pas(307): Incompatible types: 'String' and 'Integer'
[Fatal Error] attendance.dpr(11): Could not compile used unit 'u_attendance.pas'
307行是sql.add('select * from attendance where io_time>'2002-11-01' and io_time<'2002-12-04'');io_time是datetime型的
请问是什么原因?
谢谢了!
解决方案 »
- 用过RxRichEdit的来看看
- 怎么计算一个数值的变化速度?
- 有時後操作不當時會出現Access Violation at address...這樣的錯誤,代碼如下,請問如果完善?謝謝大家!
- 用writer与Treader对TMemoryStream操作报错?
- 简单问题
- 如何将Excel中的内容导入到SQL Server数据库中???
- ++++++++++++++=谁有access的解密软件,能否给我一个,++++++++++
- 如何在前段用DELPHI把文件夹,压缩包等东东,存入SQL SERVER ,并且取出?
- delphi自带的图形和按纽文件,在哪个文件夹内?
- 谁用过DELPHI 里面的DOCK 的方法?
- 请教,B/S多层开发问题
- 请问有什么代理服务器可以保存客户端的发的邮件内容?
sql.add('select * from attendance where io_time>'+''''+'2002-11-01'+''''+' and io_time<'+''''+'2002-12-04'+'''');
这样的sql语句才是
select * from attendance where io_time>'2002-11-01' and io_time<'2002-12-04'