You have the correct function and its use. What kind of error message do you get? Have you declared all your variables, including ldNewTtlDt, as date data types?
Update: Looks like you have to use this as a SQL function for it to work --
SELECT GREATEST(ldRfHrsDt, ldRfPartDt, ldRfMroDt, ldRfExpDt, ldRfShipDt) INTO ldNewTtlDt from dual;
>Hi All,
>
>In the body of a package I populate 5 variables with date values. I need to know which of these dates is the most recent. But I am unable to find the correct function for this. I tried:
>
ldNewTtlDt := GREATEST(ldRfHrsDt, ldRfPartDt, ldRfMroDt, ldRfExpDt, ldRfShipDt);
>But this didn't seem to work. I need to take the correct date and use in in my update statement.
>
>Could someone please tell me the correct function.
>
>TIA
>Mike
Mark McCasland
Midlothian, TX USA