declare @dt date
set @dt='2011-01-01'
select MI.MineCode,MI.MineName,isnull(tem.WorkPlanName,'--')工作面名称,isnull(tem.Reserves,0) 现有储量,
isnull(tem.DailyOutput,0) 当日产量,isnull(tem.Situation,'--') 采面动态情况,isnull(tem.Accident,'--') 事故影响,
isnull(tem.AccidentSolution,'--') 需要解决的问题及落实情况
from MineInfo MI
left join
(select wpdo.WorkPlaneID,wp.MineCode,wp.WorkPlanName ,wp.Reserves,wpdo.DailyOutput,wpdo.Situation,wpdo.Accident,wpdo.AccidentSolution
from WorkPlaneDailyOutput wpdo
inner join WorkPlane wp on wpdo.WorkPlaneID=wp.WorkPlanID
where wpdo.AssociationDate=@dt) tem
on MI.MineCode=tem.MineCode
把这语句放在SQLServer中执行能出结果,一放到报表中预览就报错。
大家帮看看这是哪里出错了,为什么会这样?
|