如何修复 Microsoft SSRS 中的错误 ora 01722 无效数字?

如何修复 Microsoft SSRS 中的错误 ora 01722 无效数字?

我想创建一份 ssrs 报告。以下查询在 p_year 和 p_month 参数处生成错误 ora 01722 无效数字。yearrr 和 monthhh 列为数字类型。

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

结果:ora 01722 无效号码。

没有参数的相同查询运行良好:

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

结果:几行....OK

这是什么问题以及如何使用 ssrs 报告中的参数解决它?

相关内容