How can I format the Null Dates in my Oracle SQL to 00/00/0000. I am using NVL function but it doesn't recognize the 00/00/0000 as the date format.
Is there any Date Formatting available in Oracle SQL which formats null date to 00/00/0000
How can I format the Null Dates in my Oracle SQL to 00/00/0000. I am using NVL function but it doesn't recognize the 00/00/0000 as the date format.
Is there any Date Formatting available in Oracle SQL which formats null date to 00/00/0000
Do the to_char first and wrap it in the NVL. For example,
select nvl(to_char(null, 'DD-MM-YYYY'), '00-00-0000') from dual
Use this function to assign default values of null values of date:
SELECT id, NVL(start_date, to_date('20020101','YYYYMMDD')) FROM employee;
select * from mty_containers mt where terminal_id=1
and (
in_date>=decode(to_date('','dd/mm/yyyy'),'',mt.in_date,to_date('','dd/mm/yyyy'))
or (case when '' is null then nvl(to_char(in_date,'dd/mm/yyyy'),'N') End ='N' )
)
and
(
in_date<=decode(to_date('','dd/mm/yyyy'),'',mt.in_date,to_date('','dd/mm/yyyy'))
or (case when '' is null then nvl(to_char(in_date,'dd/mm/yyyy'),'N') End ='N' )
)