I wrote a UDF called AS400Date at a previous company and was going to
reproduce it here but haven't done it yet but if you give me a few days
I can reproduce it and send you a copy. I have been needing the same
thing everyday.

AS400Date has two parms. 

The first is the value to be convert which can be one of the following
types. 

Integer
Dec( 15,0) Passed as 15,0. Operating system will map any decimal value
to 15,0
Character(10) Pass as Char(10). Operating system will map any character
to 10.
Date            Date data type just return back as date data type. 

The second parm is the type (*CCYMD, *CYMD, *YMD, *MDY, etc). This
parameter is optional. In our system, the default date format is CYYMMDD
so if you do not enter the format, it defaults to *CYMD.

All results are returned as Date Data type with null if invalid date. 

Service program has 4 functions and the command is polymorphic. Based on
the type of parameter, it will call the correct procedure. 

AS400Date(MyCYMD) Field is CYYMMDD. 

AS400Date(MyMDY,'*MDY')   



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.