I have the following function that I am using on a report for as of date:

------------------------------------------------------------------------------
function getAsOfDate(p_current_date in date) return date;
------------------------------------------------------------------------------
is
y_date date;

begin
y_date := TO CHAR(x, 'MM/DD/YYYY');

IF TO_CHAR(SYSDATE,'DY') = 'MON'
THEN
y_date = SYSDATE - 3
return(y_date);
ELSE
y_date = SYSDATE - 1
return(y_date);
END IF;

end;

How could I make the AsofDate Monday through Friday, but when it sees a Friday, it also looks at Saturday and Sunday's date for comparison on another function.

Any help is greatly appreciated.