请问这条SQL语句怎么写

edith000 2008-11-27 07:39:16
我用的是access数据库,数据库中日期格式是27/11/2008

现在想通过SQL语句指定某年某月,然后找出记录,请问这个SQL怎么写?

access 没有convert这样的函数
...全文
62 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
I_hui 2008-11-27
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 baby97 的回复:]
sql="select * from tb where format(add_date,'yyyy-mm')=#2008-11#"
[/Quote]
应该是这个了
layers2323 2008-11-27
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 baby97 的回复:]
sql="select * from tb where format(add_date,"yyyy-mm")=#2008-11#"
[/Quote]
.
kindwell 2008-11-27
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 dogfish 的回复:]
SQL codeselect * from table1 where year(enterdate) = 2008 and month(enterdate)=11
[/Quote]

我以前习惯用这种方式。
银狐被占用 2008-11-27
  • 打赏
  • 举报
回复
sql="select * from tb where format(add_date,'yyyy-mm')=#2008-11#"
银狐被占用 2008-11-27
  • 打赏
  • 举报
回复
sql="select * from tb where format(add_date,"yyyy-mm")=#2008-11#"
银狐被占用 2008-11-27
  • 打赏
  • 举报
回复
access好像有format函数。。
Dogfish 2008-11-27
  • 打赏
  • 举报
回复
select * from table1 where year(enterdate) = 2008 and month(enterdate)=11

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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