Home » Developer & Programmer » Forms » Date Comparison (Oracle form 10g)
Date Comparison [message #477477] Thu, 30 September 2010 23:46 Go to next message
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 Go to previous message
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 to
select t.some_column
  into some_variable
  from your_table t
  where t.date_column = to_date(:block.date_item, 'dd/mm/yyyy');
Previous Topic: How to use WEBUTIL to generate XLS on client machine
Next Topic: Problem using List Item
Goto Forum:
  


Current Time: Thu Sep 19 17:14:12 CDT 2024