Re: ORACLE DATE IN WHERE CLAUSE PROBLEMS

From: Keith B. McKendry <Keith_McKendry_at_csg.mot.com>
Date: 1995/06/29
Message-ID: <9506290914.ZM9856_at_MFGMPC>#1/1


I have seen several posts with various guesses at the root of your problem. I, of course, have my own guesses; however, instead of giving a guess I thought I would give a test.

do a seperate query such as:

select count(*), to_char(or_bdate,'MM-DD-YYYY') from orders
group by to_char(or_bdate,'MM-DD-YYYY');

This will show you the actual 4-digit year stored and how many on each date.

I also recommend use of trunc(or_bdate) when or_bdate is being used in a where clause. Changing MM-DD-YY to YYMMDD when doing a to_date() function will have no effect on the overall outcome.

-- 
McKendry's Uncertainty Principle:
At any given moment, one cannot be certain that any opinion is mine--much 
less SSC's or any client's.

Keith McKendry   |  73071.3233_at_compuserve.com
SSC,  Inc.       |      
Received on Thu Jun 29 1995 - 00:00:00 CEST

Original text of this message