You're trying to create an out file that lists stuff by object date. Why?
Just to sort the list? Or are you then going to say "only give me the
stuff that's x days old"?

Performance wise, it's always better to minimize your calculations. For
example, if you have a choice of taking a muffed up file like this and
converting every row into a date, or taking a host variable and making
that into a character (but only doing it once) it's better to do the
latter. IOW, it's better to do take the current date, minus x days, and
store it in the format CYYMMDD as a variable and then simply compare that
against this
ODCCEN concat right(ODCDAT, 2) concat left(ODCDAT, 4)
than it is to then convert this concantenation into a date and
subtract/add days to it and compare it against current date.

Then we get back to your original concern: How do we ensure that "current
date" is in a format easily convertable to CYYMMDD and not be concerned
about job date format and what not? Read the SET OPTION and it's DATFMT.
It's SQL's version of an RPG H spec.


Rob Berendt

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.