Hi,
Im joining 2 tables based on date field in where clause.
For eg:
select cal.date_id
from stage a
left outer join calendar cal
on
a.businessdate=cal.date_id;
Its giving the error ORA-01861-literal does not match format string
Sample values and datatype of these fields :
2025-02-17 → businessdate (varchar(128 byte) type)
01-JAN-25 → date_id (DATE type)
select a.businessda,cal.date_id
from staging a left outer join calendar cal
where
to_date(a.businessdate,'YYYY-MM-DD')=to_date(cal.date_id,'YYYY-MM-DD');
The result shows as
2025-02-17 , null
But 2nd column should show 2025-02-17 since matching record exists.
Left outer join is if matching records exists show data from left and right table else show null.
Please advice.