查询指定日期之后数据sql语句要怎么写

try999 2007-11-09 08:19:13
假设要查询20007-11-1之后有数据sql语句要怎么写
...全文
1725 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
you_tube 2007-11-09
  • 打赏
  • 举报
回复
select * from table where cast(table_time as datetime) > ´2007-11-1
窝抓了个羊 2007-11-09
  • 打赏
  • 举报
回复
select * from 表 where convert(varchar(10),日期,120)>'20007-11-1'
andy84 2007-11-09
  • 打赏
  • 举报
回复
select * from table where 时间列!> '2007-11-02 '
这个就可以了前提是你的数据库设计这列式datetime格式
如果不是
select * from titles where cast(时间列 as datetime)> '2007-11-02 '
hui_hui_2007 2007-11-09
  • 打赏
  • 举报
回复
为何贴子中自动增加空格呢?
试一下
select * from tablename
hui_hui_2007 2007-11-09
  • 打赏
  • 举报
回复
以下写法可以吧:
select * from 表名 where convert(char(10),日期字段,111) > '2007/11/01'
try999 2007-11-09
  • 打赏
  • 举报
回复
为什么我用
select * from table where 时间列!> '2007-11-02 '

select * from table where convert(varchar(10),时间列,120)> '2007-11-01 '
////////////////查询出来是所有数据
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
select * from adjust where DATEDIFF (day ,'2007-08-01' , createdate)>0
查询出没有数据啊。。
internetroot 2007-11-09
  • 打赏
  • 举报
回复
select * from adjust where DATEDIFF (day ,'2007-08-01' , createdate)>0 
中国风 2007-11-09
  • 打赏
  • 举报
回复
select * from table where 时间列!>'2007-11-02'

select * from table where convert(varchar(10),时间列,120)>'2007-11-01'

34,576

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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