关于SQL查询日期的问题

guofu007 2004-11-24 08:47:46
select * from useinfo where landdate=###
我想查找日期是本月的所有记录该怎么查呢
...全文
121 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
xczhouyang 2004-11-24
  • 打赏
  • 举报
回复
select * from useinfo where DATEDIFF( Month ,landdate ,now() ) = 0
Batistuta0614 2004-11-24
  • 打赏
  • 举报
回复
如果是ACCESS
select * from useinfo where DATEDIFF( Month ,landdate ,Getdate() ) = 0
要写成
select * from useinfo where DATEDIFF( “M” ,landdate ,date() ) = 0
oubao 2004-11-24
  • 打赏
  • 举报
回复
select * from useinfo where DATEDIFF( Month ,landdate ,Getdate() ) = 0
  • 打赏
  • 举报
回复
如果是access的话getdate()换成date()
  • 打赏
  • 举报
回复
select * from useinfo where datediff(m,landdate,getdate())=0

select * from useinfo where Year(landdate)=Year(getdate()) and Month(landdate)=Month(getdate())
ygjwjj 2004-11-24
  • 打赏
  • 举报
回复
select * from useinfo where datediff(m,landdate,getdate())>0
cailover 2004-11-24
  • 打赏
  • 举报
回复
select * from useinfo where datediff(month,landdate,getdate())=0
baikaishui_0825 2004-11-24
  • 打赏
  • 举报
回复
select * from useinfo where datediff(month,landdate,getdate())>0
Clove 2004-11-24
  • 打赏
  • 举报
回复
select * from useinfo where Year(landdate)=Year(getdate()) and Month(landdate)=Month(getdate())

28,391

社区成员

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

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