I want to create a ssrs report. The following query generates the error ora 01722 invalid number at the p_year and p_month parameters. the yearrr and monthhh columns are of type number.

SELECT e.id ,substr(c.name,1,20) name 
, p.way , e.nnumb
,substr(e.ssnumbb,1,20) ssnumbb ,COUNT(t.ids) AS xxxxx 
,nvl((select sum(coounnf) from noion where nnumb = e.nnumb and yearrr = :p_year and
monthhh = :p_month),0) ddddds 
FROM yoursur e JOIN ps c ON e.id = c.id
left join jn p on p.con = e.popl 
LEFT JOIN i t ON t.nnumb = e.nnumb AND t.date IS NULL WHERE c.si = :c 
GROUP BY e.id, c.name, p.way,e.nnumb, e.ssnumbb 
ORDER BY e.id, c.name, p.way, e.nnumb,e.ssnumbb

Result: ora 01722 invalid number.

Same query without parameters runs fine:

SELECT e.id ,substr(c.name,1,20) name 
, p.way , e.nnumb
,substr(e.ssnumbb,1,20) ssnumbb ,COUNT(t.ids) AS xxxxx 
,nvl((select sum(coounnf) from noion where nnumb = e.nnumb and yearrr = 2024 and
monthhh = 3),0) ddddds 
FROM yoursur e JOIN ps c ON e.id = c.id 
left join jn p on p.con = e.popl 
LEFT JOIN i t ON t.nnumb = e.nnumb AND t.date IS NULL WHERE c.si = :c 
GROUP BY e.id, c.name, p.way, e.nnumb,e.ssnumbb 
ORDER BY e.id, c.name, p.way, e.nnumb,e.ssnumbb

Result: several lines….OK

What is the problem and how can I solve it using parameters in ssrs report?