sql语言怎么处理时间类型 我的sql... where ... ...offerform.date=2002-10-8 and ....总是提示时间有问题,应该怎么写呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 where ........offerform.date=to_date('2002-10-08')就行了 不行 错误提示它说’to_date函数为定义!‘ where ... ...offerform.date=StrToDate(2002-10-8); offerform.date = ts{'2002-10-08'} 在Delphi中将其转为strquerey1.sql.add('select * from tbname where timefield='+quotedstr(datetostr(datetimepicker.date))) 还是不行 我是这么做的先生成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);然后执行。。可是都不好用 应该是这样吧:StrToDate('2002-10-08','yyyy-mm-dd') 你在哪用,如果是在源程序里写不能用TO_DATE只能用STRTODATE querey1.sql.add('select * from tbname where timefield='+datetostr(datetimepicker.date))就这样把它征服 用参数化查询都可以offerform.date=:dateparambyname('date').asstring:='2002-10-21'; 激情真人CS 50分求一个播放器控件 这个句子怎么写? 各位,能否提供NMFTP或者Indy控件所实现局域网文件下载功能的代码 请教:FASTREPORT的小问题: 谁能提供DELPHI的技术网站,越多越好,up有分 如何获得Jpeg、Bmp文件的对比度和亮度? 如何用DELPHI动态添加多个图象TIMAGES控件!急~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 有关打印序列号的问题。高分等待... 急死我了,帮帮忙!怎么从一个工程的窗体调用另一个工程的窗体? SQL语句的问题 怎样使服务器的时间(getdate())不显示分秒,只有小时
....offerform.date=to_date('2002-10-08')就行了
...offerform.date=StrToDate(2002-10-8);
querey1.sql.add('select * from tbname where timefield='+quotedstr(datetostr(datetimepicker.date)))
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);
然后执行。。可是都不好用
就这样把它征服
offerform.date=:date
parambyname('date').asstring:='2002-10-21';