/****** Object:  UserDefinedFunction [dbo].[F_INICIO_MES]    Script Date: 11/15/2013 16:16:07 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[F_INICIO_MES]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[F_INICIO_MES]
GO
GO
GO
--Versao 2353
CREATE FUNCTION [dbo].[F_INICIO_MES](@dtBase DATETIME) 
RETURNS DATETIME
with schemabinding AS
  begin
	RETURN DATEADD(d, (- DATEPART(d, @dtBase) + 1) , @dtBase);
  end

  