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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.