18328816101(提问者)还是差不都的问题:
SELECT sum(bh29+bh30+bh31+bh32+bh33+bh34+bh35+(isNull(bh36,0))+bh37+bh38) AS risr
FROM dbo.[uf_gl_voucher]
where datename(year,prepareddate)=${year}
and orgcode in (${bumen})
and (DATENAME(quarter, prepareddate)=${quarter}
or datename(month,prepareddate)=${month})
两种时间单独拆开查没问题,合在一起用or连接就错了,为什么