SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
IF EXISTS (SELECT name FROM sysobjects 
         WHERE name = 'CIZACNCD' AND type = 'P')
   DROP PROCEDURE RPTUSER.CIZACNCD
GO


CREATE PROCEDURE RPTUSER.CIZACNCD
@P_ACCT_ID CHAR(10),
@P_DATE    CHAR(10)

AS

/******************************************************************************
   NAME:       CIZACNCD
   PURPOSE:    

******************************************************************************/
BEGIN

    SELECT 
        SUM(A.DEP_AMT) DEP_AMT
    FROM CI_NCD A
    WHERE 
        A.ACCT_ID = @P_ACCT_ID
        AND A.START_DT <= CONVERT(CHAR(10),@P_DATE,101)
        AND(A.END_DT IS NULL OR ( 
            A.END_DT IS NOT NULL AND A.END_DT >= CONVERT(CHAR(10),@P_DATE,101)))
			 
RETURN

END



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO

