首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > IBM DB2 >

怎么将日期格式转换为timestamp

2012-03-11 
如何将日期格式转换为timestamp在DB2数据库中存储时间的时间格式是timestamp,我的SQL语句为:select*fromdc

如何将日期格式转换为timestamp
在DB2数据库中存储时间的时间格式是timestamp,我的SQL语句为:select   *   from   dcontact   where   proctime   between   startime   and   endtime;startime和endtime是20070123格式的,怎转化成timestamp格式的,请高手赐教!!!

[解决办法]
最后6位296000是微秒
[解决办法]
db2 => select *from dcontact where date(proctime) between date(substr(startime ,1,4
)|| '- '||substr(startime ,5,2)|| '- '||substr(startime ,7,2)) and date(substr(endtime,1,4
)|| '- '||substr(endtime,5,2)|| '- '||substr(endtime,7,2))

热点排行