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'; 如何将word保存到数据库指定行 老是报错 我在SQL SERVER2000里可以查询,可以DELPHI运行就说“FORM语句有错误”。 IntraWeb中Session保存对象,200分散分,高手请进! SOS,BDE连接SQL Server 2000的问题求救!! 哪能找到一个图书管理系统示例的源代码,谢谢 一个select的句子(高分) 怎样自己编写函数??? 请教一个日期转换问题 !!!打印问题:我想将查询的结果分段返回到客户端,每返回一段结果就进行相应打印!!! 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';