473,384 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,384 software developers and data experts.

JDEdwards date

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.

Sep 27 '06 #1
8 8360
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
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.
Sep 28 '06 #2
>
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.

Oct 2 '06 #3
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.
Oct 4 '06 #4

Phil Sherman wrote:
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.
That will never do... people will understand it!

Oct 4 '06 #5

I did managed to easily create the function to go back and forth. I
will provide it in case someone is looking for the logic.....

DATE to JDE Date (using DB2's current_date):
----------------------------------------------------------

DECIMAL((YEAR(current_date)-1900)*1000+DAYOFYEAR(current_date),6)


JDE Date to DATE:
------------------------
DATE(DIGITS(DECIMAL(JDE_DATE_FIELD + 1900000,7,0)))

Oct 11 '06 #6
On 10 Oct 2006 17:54:24 -0700, "no_spam_for_gman" <ga****@gmail.com>
wrote:
>
I did managed to easily create the function to go back and forth. I
will provide it in case someone is looking for the logic.....

DATE to JDE Date (using DB2's current_date):
----------------------------------------------------------

DECIMAL((YEAR(current_date)-1900)*1000+DAYOFYEAR(current_date),6)


JDE Date to DATE:
------------------------
DATE(DIGITS(DECIMAL(JDE_DATE_FIELD + 1900000,7,0)))
Populate the F00365 with as many years as you need then join the
julian date field (ONDTEJ) and use the date field (ONDATE) which is
formatted or the individual fields MM, DD, YY, CC.

I have used several different attempts at converting the date (as seen
above by others) but they all seem to fall down somewhere, i.e.
outside the IBM window (1940 through 2039).

Doug Belcher
Oct 18 '06 #7
My functions works fine. I wasn't able to find that F00365 table you
talked about.

Oct 19 '06 #8
On 19 Oct 2006 04:48:56 -0700, "no_spam_for_gman" <ga****@gmail.com>
wrote:
>My functions works fine. I wasn't able to find that F00365 table you
talked about.
F00365 - Date Translation File
PK - "Julian Date" (ONDTEJ)

Programs - J000365 - Date Translation Generation
- P000365 - Date Translation Generation

Menu - G1532 Tenant Merge Letters
option - 12 Date Translation Generation

When you did your testing did you test beyond 01/01/2040 and before
01/01/1939?
Doug
Oct 20 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: androtech | last post by:
Hello, I'm looking for a function that returns a date range for a specified week number of the year. I'm not able to find functions like this anywhere. Any pointers/help would be much...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
2
by: Tjerk | last post by:
Hello all, I have the script below to change an image depending on the date upto january it worked fine but then it just stopped working does anybody have an idea how I can make it work again or...
9
by: Thomas R. Hummel | last post by:
Hello, I am importing data that lists rates for particular coverages for a particular period of time. Unfortunately, the data source isn't very clean. I've come up with some rules that I think...
30
by: Dr John Stockton | last post by:
It has appeared that ancient sources give a method for Numeric Date Validation that involves numerous tests to determine month length; versions are often posted by incomers here. That sort of code...
0
by: bwmiller16 | last post by:
Folks - Just a quick FYI to let you know that RH Linux 3 with UDB 8.2.9 works with Peoplesoft (actually JDEdwards) just fine. We had some questions about how PS would react to having the...
3
by: captain | last post by:
Below is the sql for data with same date need to extract + or - 5 days data of same date also. How to also get data of + and - days related to same date. SELECT IM.Area, IM.Location,...
1
by: Liz Malcolm | last post by:
Hello and TIA. I have a DE form with an option group that if daily is selected todays date is used for start and end date, if weekly is selected Monday - Friday is used. I am trying to add a...
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.