1. 程式人生 > >Access日期時間查詢

Access日期時間查詢

Access日期時間條件查詢
  如果欄位的資料型別是Date/Time型別,使用普通的方式無法查詢精確到時分秒的資料,解決方案如下:

精確到日期:
select * from user where userId = 26 and createTime > #2018/1/25#

精確到時分秒(錯誤方式):
select * from user where userId = 26 and createTime = #"2018/1/25 8:23:42"#

精確到時分秒(正確方式):
select * from user where userId = 26 and createTime = cdate("2018/1/25 8:23:42");