A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Documentation says that GREATEST applies to Azure databases. Consider the alternatives:
select case when getdate() > '31-mar-2020' then getdate() else '31-mar-2020' end x
select iif(getdate() > '31-mar-2020', getdate(), '31-mar-2020') x