从一个DATATIME字段从提取毫秒?

swatchkey 2004-09-04 09:24:46
在ACCESS表中定义一个DATETIME的字段,然后写入一个精确到毫秒时间数据,比如“2004-09-03 12:12:12 438”,写入后打开ACCESS表是看不到后面的毫秒的。
但我在VB中从该表中提取该字段的数据并显示出来时仍然不能显示后面的毫秒“438”,查了很多资料,发现DELPHL中有DECODETIME这个函数可以将时间分解为到毫秒,但VB中好象没有,望大家帮帮忙,指点一下
...全文
84 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
swatchkey 2004-09-06
  • 打赏
  • 举报
回复
guxizhw(失落的彩虹),到我另外两个同样内容帖子里去,还要给两百分,呵呵
http://community.csdn.net/Expert/TopicView.asp?id=3339320
http://community.csdn.net/Expert/TopicView.asp?id=3341896
swatchkey 2004-09-06
  • 打赏
  • 举报
回复
谢谢
Andy__Huang 2004-09-05
  • 打赏
  • 举报
回复
這個用access2000不好做,如果用sql server2000,那就好做得多了
sql="select 毫秒=datepart(millisecond,getdate())"
guxizhw 2004-09-05
  • 打赏
  • 举报
回复
ServerTime = Format(rsTime.Fields(0), "yyyy-mm-dd hh:mm:ss:ms")
guxizhw 2004-09-05
  • 打赏
  • 举报
回复
Public Function ServerTime() As String

'得到服务器的时间
Dim rsTime As ADODB.Recordset
Set rsTime = New ADODB.Recordset

rsTime.Open "select getdate()", strCon

ServerTime = Format(rsTime.Fields(0), "yyyy-mm-dd hh:mm:ss")

recClose rsTime

End Function
swatchkey 2004-09-05
  • 打赏
  • 举报
回复
代码:
rs.open"select filedate from fileinfo",cn, adOpenStatic, adLockReadOnly
debug.print rs.Fields(0).Value
打印出来的值里没有后面的毫秒“438”

1,217

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧