ora-01841

absd_000 2014-03-24 04:18:19
select sum(a), sum(b), sum(c) from(
select count(distinct v.visit_id) a,count(ob.actual_dispense_amount) b, 0 c
from t_iadt_visit v,t_iadt_account a,t_idw_orderbilling ob
where v.discharge_wards =$P{ward}
and v.visit_id=a.visit_id
and ob.account_id=a.account_id
and ob.billing_type=60350
and v.discharge_datetime>= to_date($P{month}||'-01','yyyy-MM-dd')
and v.discharge_datetime< add_months(to_date($P{month}||'-01','yyyy-MM-dd'),1)
and ob.active_flag='Y'
and ob.item_type='030302'
and ob.item_id in (select i.index_item_id from t_fm_reportindexitem i where i.ri_id=24)
union all
select 0 a, 0 b,count(b.id) c from t_iadt_beds b where b.ward=$P{ward} and b.item_type='030302' and b.item_id in (select i.index_item_id from t_fm_reportindexitem i where i.ri_id=24)
)
请问为什么会出现(完整)年份值必须介于-4713和+9999之间,且不为0
...全文
198 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
卖水果的net 2014-03-25
  • 打赏
  • 举报
回复
to_date($P{month}||'-01','yyyy-MM-dd') 月+日,没年份或者年份你拼错了。
absd_000 2014-03-25
  • 打赏
  • 举报
回复
谢谢,已解决!追问:如何在Fileds里使用java代码? 例如我现在有3个统计字段sum(A)、sum(B)、sum(C),第四个Field里应该是sum(C)/sum(B),第五个Field里应该是sum(A)/sum(B),该如何书写java代码呢?急!!! 注:sum(A)、sum(B)、sum(C)是BigDecimal类型
ghw554557313 2014-03-24
  • 打赏
  • 举报
回复
to_char转成字胡窜

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧