Date to JDE Date

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!

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free