SQL Server Helper - Date Functions - Get First Day of the Month

SQL Server Helper - Date Functions - Get First Day of the Month: "CREATE FUNCTION [dbo].[ufn_GetFirstDayOfMonth] ( @pInputDate DATETIME )
RETURNS DATETIME
BEGIN

RETURN CAST(CAST(YEAR(@pInputDate) AS VARCHAR(4)) + '/' +
CAST(MONTH(@pInputDate) AS VARCHAR(2)) + '/01' AS DATETIME)

END
GO"

Popular posts from this blog

How To Configure SQL Server Reporting Services 2005 to Run in SharePoint Integrated Mode - PF