SQL server 中一个简单问题,数据类型转换

QDZZQ 2003-01-13 11:41:21
select * from tb1 where begindate='2000-01-01'
这个sql语句该怎样写?使用convert,很菜的问题
...全文
27 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
愉快的登山者 2003-01-13
  • 打赏
  • 举报
回复
直接写也可以:
select * from tb1 where begindate='2000-01-01'
用convert:
select * from tb1 where convert(char(10),begindate,120)='2000-01-01'
QDZZQ 2003-01-13
  • 打赏
  • 举报
回复
应该 Select * from tbl where ADEndTime=convert(char(12),'2003-02-02',111)
QDZZQ 2003-01-13
  • 打赏
  • 举报
回复
不行阿,老兄
wgy2008 2003-01-13
  • 打赏
  • 举报
回复
select * from tab1 where begindate = convert(char(12),2000-01-01,111)
QDZZQ 2003-01-13
  • 打赏
  • 举报
回复
关于日期的字符串怎么拼写?

34,590

社区成员

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

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