怎样 取出时间日期型的日期 例如取出"2003-12-13 9:00:00" 的"2003-12-13

chuying 2003-12-21 05:29:03
我想 问一下有没有这样的函数 一下就可以取出
还有我想 在选择记录时 where 语句可以这样写吗?
select * from aa where item_code=101 and(sampling_time>'2003-11-29' and sampling_time<'2003-12-2')
...全文
139 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
SoHo_Andy 2003-12-21
  • 打赏
  • 举报
回复
1、msgbox format("2003-12-13 9:00:00","yyyy-mm-dd")
2、可以这样
select * from aa where item_code=101 and ( sampling_time between '2003-11-29' and '2003-12-2')
rainstormmaster 2003-12-21
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
Dim a As Date
a = Now
Debug.Print a
Dim b As Date
b = DateValue(a)
Debug.Print b
End Sub
northwolves 2003-12-21
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
Dim d As Date
d = #12/13/2003 9:00:00 AM#
MsgBox Format(d, "yyyy-mm-dd")
End Sub

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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