
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[V_RC_CLI_FIDELI_VD_MES]'))
DROP VIEW [dbo].[V_RC_CLI_FIDELI_VD_MES]
GO
GO
CREATE VIEW V_RC_CLI_FIDELI_VD_MES
AS
SELECT CD_EMP, CD_CLI, DT_VD, QT_VD
        FROM   RC_CLI_FIDELI_VD
        WHERE  DT_VD BETWEEN dbo.F_INICIO_MES(CURRENT_TIMESTAMP) AND CURRENT_TIMESTAMP
GO