--Last Day of Any Month and Year DECLARE @dtDate DATETIME SET @dtDate = '8/18/2007' SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@dtDate)+1,0))
Result
2007-08-31 23:59:59.000
No comments:
Post a Comment