Tuesday, July 5, 2022

SQL Server Clause IF ELSE Condition

 IF (@Batch_Start_date>='01/01/2021')

BEGIN

SET @FinacialYearValue = @Year

END

ELSE

BEGIN

SET @FinacialYearValue = (CASE WHEN @Month <=3 THEN @Year-1 ELSE @Year END)

END

No comments:

Post a Comment