Year = current year

If my booking year = system year then cy else py

not sure what was the error in beast mode..pls suggest

CASE 

WHEN YEAR(`Booking Year Nbr`)= YEAR(CURDATE(),"CY" ELSE "PY" END

Comments

  • GrantSmith
    GrantSmith Indiana 🥷

    Some minor tweaks to your beast mode:

    CASE 
    WHEN YEAR(`Booking Year Nbr`)= YEAR(CURDATE()) THEN "CY"
    ELSE "PY"
    END
    
    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • Hi @RajNadar

    It would help to understand what format `Booking Year Nbr` is in.

    CASE 
    WHEN `Booking Year Nbr` = YEAR(CURDATE()) THEN 'CY' 
    WHEN `Booking Year Nbr` = YEAR(CURDATE())-1 THEN 'PY' 
    ELSE 'Other' 
    END
    

    ______________________________________________________________________________________________
    “There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
    ______________________________________________________________________________________________