Date Comparison [message #477477] |
Thu, 30 September 2010 23:46 |
swapnil_naik
Messages: 269 Registered: December 2009 Location: Mumbai
|
Senior Member |
|
|
Hi ,
In my form i have a date field which format mask is DD/MM/RRRR
AND i want TO show data from field date matches with database date field...in my database date saved in format of 04/01/2009'
HOW TO show data when form field data matches with database field data...
My Database date field SAVED in format of '04/01/2009'
My Entered date in screen '01/04/2009'..
when both date matches respective data shown..
please help me to solve the problem
|
|
|
Re: Date Comparison [message #477485 is a reply to message #477477] |
Fri, 01 October 2010 01:26 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
If both database column and form item are of DATE datatype, you don't have to do anything, simply compare them:select t.some_column
into some_variable
from your_table t
where t.date_column = :block.date_item; The fact that you see those values differently won't fool Oracle.
In any other case, you'd have to use TO_DATE (or TO_CHAR) function, with the correct format mask. For example, if form item was CHARACTER, you'd have toselect t.some_column
into some_variable
from your_table t
where t.date_column = to_date(:block.date_item, 'dd/mm/yyyy');
|
|
|