× 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 2/14/11 6:53 AM, rob@xxxxxxxxx wrote:
<<SNIP>>

I had trouble trying this:
CREATE INDEX ROB/oldtablel01
ON ROB/OLDTABLE
(numtodate(OLDDATEASNBR) ASC)

But I could get this to work:
CREATE INDEX ROB/oldtablel01
ON ROB/OLDTABLE
(DATE(SUBSTR(CHAR(oldDateAsNbr),1,4)||'-'||
SUBSTR(CHAR(oldDateAsNbr),5,2)||'-'||
SUBSTR(CHAR(oldDateAsNbr),7,2) ))

On 2/14/11 6:03 AM, Jason Abreu wrote:
<<SNIP>> Of course, this assumes you do not have any nulls in
oldDateAsNbr and all values of oldDateAsNbr have a length of 8 and
can convert to valid dates.

That restriction on the UDF in a derived key INDEX is a good reason to use a VIEW to encapsulate the expression [instead], then the same expression used in the INDEX as in the VIEW.

However the above quoted expression is hardly a good choice since the numeric values are apparently already YYYYMMDD for which others already have suggested a much better expression of DATE(char-14-D\T-expression) [which would have the same deficiency as the above for having used CHAR instead of DIGITS].

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.