ALTER PROCEDURE [dbo].[usp_Payroll_CurrentFinancialYear_Select] (@Date DATETIME=NULL) AS BEGIN DECLARE @Year INT =0 DECLARE @Month INT=0 DECLARE @FinYearID INT=0 DECLARE @CheckYear VARCHAR(10)=NULL SET @Date=ISNULL(@Date,GETDATE()) SELECT @Year=YEAR(@Date) SELECT @Month=MONTH(@Date) IF(@Month>3) BEGIN SET @CheckYear=@Year END ELSE BEGIN SET @CheckYear=@Year-1 END SELECT @FinYearID=FinYearID FROM Common_FinancialYearMaster WHERE FinYear LIKE @CheckYear + '%' RETURN @FinYearID END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)