× 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.



It costs no more to do 400 as it does 20 or 100. The 2 digit year format repeat is certainly a consideration. You'd need a mechanism to discriminate centuries. Joining on a 2 digit year formatted date would definitely be problematic.



Sent from my T-Mobile 4G LTE Device



-------- Original message --------
From: John Yeung <gallium.arsenide@xxxxxxxxx>
Date: 8/18/23 11:58 AM (GMT-08:00)
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: help with SQL date coversion

On Thu, Aug 17, 2023 at 4:14 AM Alan Campin <alan0307d@xxxxxxxxx> wrote:

Then just write a quick and dirty program to write dates
for 20 years or so.

In my opinion, you might as well do a lot more. I like to do 400
years, specifically 1900 through 2299, because that's the length of a
complete cycle in the Gregorian calendar (146,097 days). I like to
start at 1900 because that's when Excel dates start.

I think a decent case could be made for building a table of only 100
years (36,525 days, assuming the year 2000 is included), so that
formats involving 2-digit years don't repeat. I don't see much value
in anything smaller than that. If you specifically want dates that are
too far in the past or too far in the future to be considered invalid,
test against actual cutoff dates instead of relying on being missing
from the table. You'll probably want to fine-tune the cutoff dates
depending on the application anyway. (20 years wouldn't be enough to
cover people's birthdates, or home mortgage end dates, to take a
couple of obvious examples.)

John Y.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&data=05%7C01%7C%7C087f854a581c40f436bd08dba01d2267%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638279819213734856%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=86O5r4VGPQFoYct8r4zvfGIClHqSJwxTK8lRlXt1NO0%3D&reserved=0<https://lists.midrange.com/mailman/listinfo/rpg400-l>
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&data=05%7C01%7C%7C087f854a581c40f436bd08dba01d2267%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638279819213734856%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gMdSpNUEUiFQ0xmXepB%2B4jhCDe0El9mbMeAF6wF9tbQ%3D&reserved=0<https://archive.midrange.com/rpg400-l>.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.