获取某天的(开始结束)(某月的开始与结束)时间

SELECT dateadd(ms,0,DATEADD(dd, DATEDIFF(dd,0,getdate()), 0))                               
SELECT dateadd(ms,-3,DATEADD(dd, DATEDIFF(dd,-1,getdate()), 0))
SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)                                            
SELECT   dateadd(ms,-3,DATEADD(mm,   DATEDIFF(m,0,getdate())+1,   0))  

posted @ 2019-08-30 14:12  牧夫座  阅读(199)  评论(0编辑  收藏  举报