In a function I want to pass a date. beDate is what i am passing.

I want to update beDate as last day of beDate month if beDate is Last\_business\_day otherwise last\_day of previous month.

Can someone lease provide the syntactically correct answer for the IF part in the below code.

```
CREATE OR REPLACE Function AnyFunction ( beDate IN varchar2 )
   RETURN date
IS

IF beDate = [ Last_Business_Day ] then beDate = last_day(beDate) ;

ELSIF beDate >  [ Last_Business_Day ] then beDate = last_day(beDate) ;

ELSE beDate = last_day(add_months(last_day(beDate),-1) ) ;

END IF ;

BEGIN 

END;

```