On 31-May-2011 11:38 , Alan Shore wrote:

I have a file (FILEA) that contains a time stamp field
Using SQL on the file, the time stamp is displayed as
2011-05-26-22.04.08.076000
I have another file (FILEB) that contains data that I want to
populate FILEA with
Here's the problem
FILEB contains a 6 digit numeric field that represents a date.
<add> the numeric date field is in MMDDYY format.
I need this to be in the timestamp field in FILEA
My question is :- Can this be done? And how
I have tried using date in SQL, but I cannot see how to transpose
that to a timestamp I am not concerned about the time in the
timestamp, so a time of noon would suffice


If using v6r1 and all values of the numeric field will represent valid 6-digit dates then perhaps the following could be attempted:

select TIMESTAMP_FORMAT(
insert( insert( digits( Num6Fld ), 5, 0, '/'), 3, 0, '/')
, 'MM/DD/YY' )
from FILEB

I would hope that the YY adjustment follows the default database [SQL] 100-year window; the documentation is lacking, per usual. If someone uses or has used that SQL builtin scalar for YY, I would be curious to know.

Regards, Chuck

This thread ...


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

This mailing list archive is Copyright 1997-2019 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].