I know since we posted the JDE date to real date function, everyone has been wondering where the real date to JDE date function is.  Well, “ask and you shall receive.”

drop function myuser.DateToJ!

CREATE function myuser.DateToJ (RealDate date)
    returns decimal(8,0)
    language sql
    deterministic
    no external action
begin atomic
   if RealDate is null then
      return 0;
   else
      return ((Year(RealDate) - 1900) * 1000) + DayOfYear(RealDate);
   end if;
end!


select myuser.DateToJ(date('2008-11-18'))
from myuser.dual!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>