× 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 11-Feb-2015 14:15 -0600, Mark S Waterbury wrote:
<<SNIP>>

You could then do something like this -- (for example with an outfile
in QTEMP created with the DSPOBJD command), -- using SQL:

update QTEMP/DSPOBJD
set ODCDAT = substr(ODCDAT,5,2) || substr(ODCDAT,1,2) ||
substr(ODCDAT,3,2)
[...]
set ODJDAT = substr(ODJDAT,5,2) || substr(ODJDAT,1,2) ||
substr(ODJDAT,3,2)

to change all of those fields with dates stored as "MMDDYY" to
"YYMMDD" in one pass over the file ...

Then, you can query more easily, sorting those dates is much
easier, etc.


FWiW, a suggested [at least in part, required] revision to the UPDATE offered in the above quoted message:

update the_DSPOBJD_outfile
set ODCDAT = substr(ODCDAT, 5, 2) || substr(ODCDAT, 1, 4)
, set ODSDAT = substr(ODSDAT, 5, 2) || substr(ODSDAT, 1, 4)
, set ODRDAT = substr(ODRDAT, 5, 2) || substr(ODRDAT, 1, 4)
, set ODLDAT = substr(ODLDAT, 5, 2) || substr(ODLDAT, 1, 4)
, set ODUDAT = substr(ODUDAT, 5, 2) || substr(ODUDAT, 1, 4)
, set ODTDAT = substr(ODTDAT, 5, 2) || substr(ODTDAT, 1, 4)
, set ODADAT = substr(ODADAT, 5, 2) || substr(ODADAT, 1, 4)
, set ODJRDT = substr(ODJRDT, 5, 2) || substr(ODJRDT, 1, 4)

The above UPDATE is a revision from what was in the quoted message, both to be functional in environments where the comma may define the decimal separator and to reduce the overall expression in each SET clause to just one concatenation of just two substring expressions each; the column name for the Journal Date field named in the assignment and expression of the final SET clause is also corrected.


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