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




-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of dale janus


We want to select by year, so all we need are the last 2
characters of
the field. This works ok for months 10, 11 and 12 when the field is
full. For the other 9 months, when there is a zero in the first
position, it gives fetch failure errors.

SQL is performing default numeric to character conversion. That appears to be CHAR() conversion, which drops leading zeros from the numeric input. Thus your substring specification starting position is off by one; the digits to compare are shifted one position left. Using DIGITS() instead of the default conversion helps as that function does not drop leading zeros.

You might want to specify a character value for comparison to avoid another under-the-covers conversion:

select where digits() = '10' ....

_______________


Confidentiality Notice: This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.

________________

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.