Thread: JDEdwards date
View Single Post

   
  #4 (permalink)  
Old 02-27-2008, 08:23 AM
Phil Sherman
 
Posts: n/a
Default Re: JDEdwards date

Thanks for the info about non-linear composition of the JD Edwards
dates. I'd rather use the SQL math functions:

date(693595)+(JDE_Date/1000) years + mod(JDE_Date,1000) days


Phil Sherman



JohnO wrote:
>> no_spam_for_gman wrote:
>>> Hi,
>>>
>>> Has anybody ever created a DB2 date function to convert a JDEdwards
>>> date to a db2 date?
>>>
>>> Example:
>>> September 28 is 106271 in JDEdwards.
>>>

>
> <Top post corrected>
>
> Phil Sherman wrote:
>> Why don't you figure it out yourself. If you know the JDE numeric date
>> for a given Gregorian date, then the conversion is quite simple.
>> 1. Obtain the starting date for JDE's form of a Julian date
>> 2. Write a function to do the conversion.
>>
>> Or you can use the following as a starting point:
>>
>> date(626311+106271)
>>
>> Phil Sherman
>>

>
> Not quite that simple - the JDE Julian date function is not linear but
> steps at year boundaries as the first 3 digits are the years past 1900,
> and the last 3 are the day number within the year.
>
> You need something like
>
> date(693595) +
> (106271 / 1000) years +
> (((106271/1000.000000) - 106271 / 1000) * 1000) days
>
> where 693595 corresponds to the1889-12-31 epoch.
>

Reply With Quote