数据列设置了形态,实际值是ID,显示值是名称,但预览时显示的还是ID。找了半天原因,发现是用了year函数造成的。
数据集是这样写的:SELECT mine.mineCityID,city.CityName,mine.mineCountyID,county.CountryName,mine.mineCode,mine.mineName,isnull(round(njh.ymsc/12,0),0) ymscyjh,isnull(round(njh.zjc/12,0),0) zjcyjh,isnull(round(njh.ktjc/12,0),0) ktjcyjh,isnull(round(njh.zbjc/12,0),0) zbjcyjh,isnull(round(njh.jmsc/12,0),0) jmscyjh
FROM dbo.MineInfo mine
LEFT JOIN dbo.MineCity city ON mine.MineCityID=city.CityID
LEFT JOIN dbo.MineCounty county ON mine.MineCountyID=county.CountryID
LEFT JOIN dbo.BB_DDNJH njh ON mine.MineCode=njh.mine_id
WHERE mine.MineCode NOT LIKE '20%' AND njh.nf=WHERE njh.nf=YEAR('${time}')
把最后的where条件njh.nf=YEAR('${time}')改成njh.nf=2013就正常了。