|
On 8/31/2011 9:02 PM, Pete Hall wrote:
It really doesn't take much work to create a calendar file consisting
of a real date and the CCYYMMDD equivalent (and whatever other date
variants you need.) A program to load the calendar data is pretty
simple. I can provide an example if you're interested. Calendar files
are very useful for joining dissimilar date representation types.
A really good general suggestion. Calendars also provide support for
holidays and such that you just can't get otherwise.
You might also use an SQL function, or a host variable to provide the
CCYYMMDD date, since the date is in the where clause, and not the
result table.
If nothing else, I think this general concept which Chuck has been
hammering at can be taken away: when comparing dissimilar types that
require a conversion, try to put the conversion in the where clause and
not on the result column. That lets SQL do more optimization than it
would otherwise be able to do.
Joe
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.