﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date, ,>
-- Description:	<Description, ,>
-- =============================================
CREATE FUNCTION [C6MartPeriodico].[getNumeroElaborazioniEmailAlMese]
(
)
RETURNS INT
AS
BEGIN
	-- Declare the return variable here
	DECLARE @NUM AS INT
	select @NUM = count(*)
	from C6MartPeriodico.ELABORAZIONI_EMAIL_RNA
	where (DATEDIFF(MONTH, Data_Elaborazione, GETDATE()) = 0) 
	RETURN @NUM
END