/ Published in: SQL
URL: http://www.databasejournal.com/scripts/article.php/3583671/Get-FirstLast-Date-of-Month.htm
Expand |
Embed | Plain Text
CREATE FUNCTION [GetLastDateofMonth] (@Date AS DateTime) RETURNS DateTime AS BEGIN Declare @LastDate DateTime SET @LastDate = DateAdd(Month, 1, @Date - Day(@Date) + 1) -1 RETURN @LastDate END GO
You need to login to post a comment.
