This content has been marked as final. Show 2 replies
sysdate contains both date and current time elements, down to seconds. You will never find a match on sysdate, unless you hit the query at exactly the right time that matches some record in your table.1 person found this helpful
Set your where clause to:
( trunc (test_date) = trunc (sysdate) )
The "trunc" truncates (removes) the time element from your date values before doing the conditional test.
when i select sysdate from dual then it works 27-NOV-12Do this in SQL Plus:
That will enable you to see the true date and time contained in your date datatypes. Here is an example:
alter session set nls_date_format='mm-dd-yyyy hh24:mi:ss';
Note in Forms, you can use two datatypes: DATE and DATETIME The both will query a date from the database, but the DATE datatype will remove the time element in the form, so a data change occurs. If you want to see the full date and time from the database column, use DATETIME, and set the Format Mask to something that will display everything.
SQL> select sysdate from dual; SYSDATE --------- 27-NOV-12 SQL> alter session set nls_date_format='mm-dd-yyyy hh24:mi:ss'; Session altered. SQL> select sysdate from dual; SYSDATE ------------------- 11-27-2012 11:47:37
Edited by: Steve Cosner on Nov 27, 2012 11:42 AM