Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>How were the records inserted? </p> <p>Date fields do store time information, and thus when inserting records using sysdate, the date field will contain different "values" for records within that day. When you execute date_proc = '05-JUL-08', you are saying where date_proc equals exactly the 5th of July 2008 at 12:01:00. If you inserted the record at 12:01 with sysdate, it will not be returned. Have you tried using a between or trunc?</p> <p>Here is an example:</p> <pre><code>drop table test_date; create table test_date (id number, ud date); insert into test_date values (1, '15-jan-10'); insert into test_date values (2, '15-jan-10'); insert into test_date values (3, '15-jan-10'); insert into test_date values (6, sysdate); -- sysdate as of writing is 15-JAN-2010 08:01:55 insert into test_date values (7, sysdate); -- sysdate as of writing is 15-JAN-2010 08:01:55 insert into test_date values (8, '16-jan-10'); commit; select id, ud, to_char(ud, 'dd-MON-yyyy HH:MM:SS') from test_date where ud = '15-jan-10'; ---------------------- ------------------------- -------------------- 1 15-JAN-10 15-JAN-2010 12:01:00 2 15-JAN-10 15-JAN-2010 12:01:00 3 15-JAN-10 15-JAN-2010 12:01:00 select id, ud, to_char(ud, 'dd-MON-yyyy HH:MM:SS') from test_date where trunc(ud) = '15-jan-2010'; ---------------------- ------------------------- -------------------- 1 15-JAN-10 15-JAN-2010 12:01:00 2 15-JAN-10 15-JAN-2010 12:01:00 3 15-JAN-10 15-JAN-2010 12:01:00 6 15-JAN-10 15-JAN-2010 08:01:55 7 15-JAN-10 15-JAN-2010 08:01:55 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload