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



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

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.