|
On Fri, May 4, 2018 at 6:05 PM, Dan <dan27649@xxxxxxxxx> wrote:
The following does it, but it seems to me that there should be an easier
way, utilizing less than four functions to do the conversion. Is there?
select BI_DOSA,
Dec( Replace(
Cast( Date(TIMESTAMP_FORMAT( BI_DOSA, 'MM/DD/YYYY'))
as Char(10)),
'-', ''),8)
from CA8560BIP
Well, maybe? On our 7.1 machine, you can dispense with the
TIMESTAMP_FORMAT. The DATE function converts the string directly. Big
caveat: I can't remember if Barbara said that this only incidentally
works on single-digit months and days. In some context or another (so
I can't be sure it applies here), the intended behavior was that
two-digit months and days were required. And it's only an accident and
not guaranteed that single-digit inputs will be accepted.
months and days? If neither DATE nor TIMESTAMP_FORMAT do, then it gets
even hairier.
As an Amazon Associate we earn from qualifying purchases.
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.