[ajug-members] Oracle query
Lisle E. Mose
lisle.mose at onlinebankingsolutions.com
Fri Jun 11 14:07:41 EDT 2004
It appears that
to_char(es.ESM_CRITICAL_DATE_VALUE,'DD-Mon-YYYY') < '02-Jun-2004'
is performing an alphabetical string comparison. i.e. '30-Apr' is not
less than '02-Jun' as far as characters are concerned.
-Lisle
On Fri, 2004-06-11 at 13:10, Barnes, Michael D wrote:
> I have a java program that connects to oracle and does the following
> query
>
> select clli,lwtr_date,es.ESM_CRITICAL_DATE_VALUE
> from esm_staging es
> where
> (clli = 'MLBRFLMA' and to_char(es.LWTR_DATE,'DD-Mon-YYYY') =
> '02-Jun-2004') and
> to_char(es.ESM_CRITICAL_DATE_VALUE,'DD-Mon-YYYY') <
> '02-Jun-2004'
>
>
> Unfortunately I am not getting any data back even though I have 1
> record that meets this criteria. Could someone help me understand why
> this query does not work.
>
> Data value in oracle:
>
> CLLI LWTR_DATE ESM_CRITICAL_DATE_VALUE
> MLBRFLMA 06/02/2004 04/30/2004
>
> Thanks
> Mike Barnes
>
> 404-927-1072
>
> *****
>
> The information transmitted is intended only for the person or entity
> to which it is addressed and may contain confidential, proprietary,
> and/or privileged material. Any review, retransmission, dissemination
> or other use of, or taking of any action in reliance upon this
> information by persons or entities other than the intended recipient
> is prohibited. If you recieved this in error, please contact the
> sender and delete the material from all computers. 152
>
>
>
> ______________________________________________________________________
>
>
> _______________________________________________
> ajug-members mailing list
> ajug-members at ajug.org
> http://www.ajug.org/mailman/listinfo/ajug-members
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ajug.org/pipermail/ajug-members/attachments/20040611/e65f1439/attachment.html
More information about the ajug-members
mailing list