× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



An old but interesting blog post I ran across not too long ago that
discusses the history of the bug.
http://www.joelonsoftware.com/items/2006/06/16.html


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Monday, December 09, 2013 8:31 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: SQL UDF problem

On Mon, Dec 9, 2013 at 7:44 AM, CRPence <CRPbottle@xxxxxxxxx> wrote:
And then I am left wondering how the "+2" fits in with the "# of
days since 01/01/1900". Seems something is amiss, given the input
value of
19000101 would return two versus zero.? I suppose if the intention
was to represent the number of days since 31-Dec-1899 inclusive of the

date offered as input, then adding two to the difference makes sense.

But what about numeric values representing dates from before that
apparent start date; almost seems the test for greater-than zero maybe

should be greater than 19000100.?

The early design of dates in Excel borrows heavily from Lotus 1-2-3, and
Lotus has a flaw, due either to ignorance, carelessness, or deliberate
risk calculation that users will not need dates before 1900-03-01.

Yes, I said March 1, 1900.

You see, the original date calculation considers 1900-02-29 a valid
date. I.e., it incorrectly considers 1900 a leap year.

It numbers the days starting with 1900-01-01 as 1, 1900-01-02 as 2, etc.
until 1900-02-28 as 59, then 1900-02-29 as 60, 1900-03-01 as 61, and
then consistently adds one from there.

Peter's solution matches Excel for 1900-03-01 and later.

John
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.




Kevin Bucknum
Senior Programmer Analyst
MEDDATA/MEDTRON
Tel: 985-893-2550


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.