I have a date that I am pulling from an AS400 application though LEI to a Domino database. One of the fields is a date field, however it is on the AS400 as a number, or hundred year date. How can I change this back to a date? Is there a standard when someone codes using the hundred year date? or is up to the programmer?
Thanks
Deb
Subject: One hundred year date format
Are you talking about a numeric field such that the value is 1051215 for December 15, 2005?
Subject: RE: One hundred year date format
Yes! That is what the AS400 field data is, I need to turn it back to a readable date.
Thanks!
Subject: RE: One hundred year date format
OK. I’m not sure if this will work for you. We do a lot of AS400 query here, and the date fields in our DB are of the form 1050725 for yr=2005, mo=07 and day=25.
I’m not sure how to get it into a Notes date field, but at least I can get you started. The formula is
date + 19000000 so that
1050725 + 19000000 = 20050725. From there, you have to take substr and cat it into the correct format.
This works, of course, for any date from year 1900 onward.
I sure hope this helps!
Bruce
Subject: RE: One hundred year date format
Thanks for the response. However my number is only 5 digits, example is 38465, which should be 05/11/05. Any thoughts? The vendor that created the AS400 software is not helpful.
Thanks
Subject: RE: One hundred year date format
Check the values. If 38465 actually corresponds to April 24, 2005 or the number for May 11 is actually 38482, then he’s counting days since December 31, 1899. You can just Cdat the number to make it a Notes date-time variant value. If the pattern’s right but the base date is wrong (38465 gives January 17, 1901 from May 11, 2005), then add the offset amount before using Cdat.
Subject: RE: One hundred year date format
Thanks for clearing that up, Stan. Obviously I need to read the posts a bit more carefully before I respond.
Subject: RE: One hundred year date format
You answered the question that was asked. I spotted the number and saw that the question seemed to be wrong.
Subject: RE: One hundred year date format
Thanks guys! And yes I should been more specific and given an example.
I will try the Cdat.
Deb