08 2018 档案

摘要:--查询当天: select * from info where DateDiff(dd,datetime,getdate())=0 --查询24小时内的: select * from info where DateDiff(hh,datetime,getDate())<=24 --info为表名, 阅读全文
posted @ 2018-08-21 10:02 大师兄丶 阅读(22974) 评论(0) 推荐(0) 编辑
摘要:一般存入数据库中的时间格式为yyyy-mm-ddhh:mm:ss 如果要转换为yyyy-mm-dd 短日期格式.可以使用convert函数.下面是sqlserver帮助中关于convert函数的声明:使用 CONVERT: CONVERT (data_type[(length)],expressio 阅读全文
posted @ 2018-08-02 13:49 大师兄丶 阅读(8730) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示