DATE( SUBSTR( DIGITS( DateField ), 1, 4 ) || '-' ||
SUBSTR( DIGITS( DateField ), 5, 2 ) || '-' ||
SUBSTR( DIGITS( DateField ), 7, 2 ) )

This converts the numeric value to an ISO date format text string then converts that to a date with DATE().

Paul Morgan

Principal Programmer Analyst
IT Supply Chain/Replenishment

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of James Lampert
Sent: Monday, May 09, 2011 2:32 PM
To: Midrange Systems Technical Discussion
Subject: Another SQL newbie question

Anybody know of a good way to get an SQL DATE in a view, from a date
stored YYYYMMDD in a zoned decimal(8,0) in the PF?

--
JHHL

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