sql语言怎么处理时间类型

我的sql
...
where ...
...offerform.date=2002-10-8 and ...
总是提示时间有问题,应该怎么写呢?
[107 byte] By [leo_zzz-leo] at [2008-2-13]
# 1
where ...
...offerform.date=to_date('2002-10-08')就行了
lf43-小飞侠 at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 2
是否应该通过函数解决?!
feiniao921-飞鸟 at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 3
不行 错误提示它说’to_date函数为定义!‘
leo_zzz-leo at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 4
大家谁能告诉我啊
leo_zzz-leo at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 5
where ...
...offerform.date=StrToDate(2002-10-8);
wyqwn-飞扬 at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 6
offerform.date = ts{'2002-10-08'}
westfly-左眼 at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 7
在Delphi中将其转为str
querey1.sql.add('select * from tbname where timefield='+quotedstr(datetostr(datetimepicker.date)))
xxyzjf-Diamond at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 8
还是不行 我是这么做的

先生成string类型的sql语句

...
if label2.caption<>''
then
begin
sqls:=format(' %s %s offerform.时间=ts{%s}',[sqls,sep,label2.caption]);
或是
sqls:=format(' %s %s offerform.时间=to_date(%s)',[sqls,sep,label2.caption]);//都不行。。。
sep:='and';
end;
...
其中label2.caption就是由date类型的转换过来的例如 2002-10-2

然后在由 ADOSQL.SQL.Add(sqls);
然后执行。。可是都不好用
leo_zzz-leo at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 9
应该是这样吧:StrToDate('2002-10-08','yyyy-mm-dd')
ll779902 at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 10
你在哪用,如果是在源程序里写不能用TO_DATE只能用STRTODATE
lf43-小飞侠 at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 11
querey1.sql.add('select * from tbname where timefield='+datetostr(datetimepicker.date))
就这样把它征服
iceshape-iceshape at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 12
所用数据库不同则处理方法不同!
连用的数据库是什么都没搞清楚,讨论豪无意义!
shuangsa-双萨 at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...
# 13
用参数化查询都可以
offerform.date=:date
parambyname('date').asstring:='2002-10-21';
ssl2000-大宋 at 2007-10-23 > top of Msdn China Tech,Delphi,数据库相关...