Date2Use := @If( so_salestatus="Won";so_actclosedate; so_salestatus="Lost"; so_LostDate; so_projclosedate); @If( @Month(Date2Use) > 0 & @Month(Date2Use) <= 6 ; @Year(Date2Use); @Year(@Adjust(Date2Use;1;0;0;0;0;0)) )