在dephi中的要比较日期类型的数据,应该用什么格式?
比如:
要查找日期为2005-10-12日的数据
sql.add('select * from table where 日期='?'');
'?'处应该用什么格式写出要比较的日期?
比如:
要查找日期为2005-10-12日的数据
sql.add('select * from table where 日期='?'');
'?'处应该用什么格式写出要比较的日期?
解决方案 »
- 用过dbgrideh的朋友请进,有问题请教!
- 怎样使ListView里面的数据能正确排序??
- Delphi有没有类似C++的This指针?好像不是Self。。。
- 困扰我的难题啊--复核窗体,在线等候。。。
- 用Installsheild express做安装文件问题?怎样能打包成一个安装文件
- 一个简单的sql语句问题,不想找资料,麻烦帮忙。
- 怎么动态创建对象?
- 在插入触发器中如何取得当前记录的值?
- SQL有问题
- 请问[Warning] untselectlist.pas(7): Unit 'ShellCtrls' is specific to a platform是什么意思,,小弟不懂!
- 高手帮我看看
- 关于已有值的字段赋为空的问题
Parameters[0].Value:=StrToDate(Edit1.Text);
Open;
'select * from aa where (EnterTime>='+''''+FormatDateTime('mm',EnterTimeDTP.DateTime)+
'/'+FormatDateTime('dd',EnterTimeDTP.DateTime)+'/'+FormatDateTime('yyyy',EnterTimeDTP.DateTime)+
' 00:00:00:00'+''''+') ';
Access:
decodeDate(DateTimePicker1.DateTime,yyyy,mm,dd);
tempsql:='select * from aa where 日期 Between '+'#'+inttostr(mm)+'/'+inttostr(dd)+'/'+inttostr(yyyy)+'# And ';
decodeDate(DateTimePicker2.DateTime,yyyy,mm,dd);
tempsql:=tempsql+'#'+inttostr(mm)+'/'+inttostr(dd)+'/'+inttostr(yyyy)+'#')