您的位置:程序门 -> db2 -> 数据库开发



如何将日期格式转换为timestamp


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


如何将日期格式转换为timestamp
发表于:2007-01-23 09:49:54 楼主
在db2数据库中存储时间的时间格式是timestamp,我的sql语句为:select   *   from   dcontact   where   proctime   between   startime   and   endtime;startime和endtime是20070123格式的,怎转化成timestamp格式的,请高手赐教!!!
发表于:2007-01-23 09:53:171楼 得分:0
还有,我的表中timestamp是 '2007-01-22   14:48:18.296000 '格式的,请问最后6位296000是什么?
发表于:2007-01-29 23:06:422楼 得分:0
最后6位296000是微秒
发表于:2007-02-01 11:55:163楼 得分:0
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))


快速检索

最新资讯
热门点击