Forum Discussion
Paginated Report ORA-01861 Error
Hi Anonymous ,
ORA-01861 databases occur when “literal does not match format string”. A real value in Oracle is a fixed, given data point. For example, in a given list of names, you might have literals like “BRAD” or “CHERIE”, known as character literals.
Try the solutions here:
https://www.techonthenet.com/oracle/errors/ora01861.php
Best Regards,
Jay
I've updated my query to the below and get a ORA-01843: "not a valid month" error within Oracle SQL Developer. Instead of having a secondary query to inject the parameters and having to worry about all that, I just added the case statements determining which quarter to the main query and feeding the corresponding quarter in accordingly. When I do run the case statement from dual, then I do return 'Q3' given it's August and August is Q3....so I know it's returning the right quarter for this particular month.
select distinct p.personNumber, p.dsplyName,
case
when to_char(sysdate,'mm') in('01','02','03') then 'Q1'
when to_char(sysdate,'mm') in ('04','05','06') then 'Q2'
when to_char(sysdate,'mm') in ('07','08','09') then 'Q3'
when to_char(sysdate,'mm') in ('10','11','12') then 'Q4'
end as quarter,
NVL((select c.count from tableC c
where c.year = to_date('2022', 'yyyy')
and c.quarter = to_char(quarter)
and c.personNumber = p.personNumber),0) as chkaccts,
NVL((select r.count from tableR r
where r.year = to_date('2022', 'yyyy')
and r.quarter = to_char(quarter)
and r.personNumber = p.personNumber),0) as reods
from tableA a, tableP p, tableE e
where a.personNumber = p.personNumber
and a.personNumber = e.personNumber
and (e.inactivedate is null or e.inactivedate > sysdate - 366)
*Edit: Once I put that query into Power BI Report Builder and run the report, still same error as the original *