Home Forums SQL Server 7,2000 T-SQL How to get the last day of the month RE: How to get the last day of the month
Ninja's_RGR'us
SSC Guru
Points: 294069
More actions
November 29, 2004 at 12:37 pm
#531774
From somewhere on this site (don't have the URL to give credit)
CREATE FUNCTION [dbo].[getMthEndDate] (@date datetime)
RETURNS DATETIME
AS
BEGIN
RETURN dateadd(month,1+datediff(month,0,@date),0) - 1
END