[code]
create table test_date
(creation_date date);
[/code]
[code]
Insert into test_date
(CREATION_DATE)
Values
(TO_DATE(’07/14/2017 14:45:10′, ‘MM/DD/YYYY HH24:MI:SS’));
COMMIT;
[/code]
–My code
[code]
select * from test_date
where
TO_CHAR(creation_date,’DD-MON-YY’) = NVL(TO_CHAR (TO_DATE (:pv_date, ‘YYYY-MM-DD HH24:MI:SS’), ‘DD-MON-YY’), TO_CHAR(creation_date,’DD-MON-YY’));
[/code]
I am comparing dates in my code using the fnd_standard_date valueset. But it is not fetching data.
I am passing pv_date = ’14-JUL-2017′.
Can anyone please help.
The parameter should pass as VARCHAR datatype not date datatype in plsql code.
Hi Maran
The format mask for the FND_STANDARD_DATE data type is “YYYY/MM/DD HH24:MI:SS”. As a result, PLSQL procedure will receive a value like ‘2017/07/14 00:00:00’ as the date.
so if you want to query from database you need to use this format : (2017/07/14 00:00:00) not ’14-JUL-2017′