【发布时间】:2010-09-29 13:22:00
【问题描述】:
我正在 Reporting Services 2005 中构建一个报表,其中数据是从 Informix 数据库中检索的。通过 ODBC 声明与数据库的连接。这是查询的更简单版本:
select
prodtype,
familynum,
family,
sum(invested) invested,
month(recevdate) month,
year(recevdate) year,
day(recevdate) day,
'All Year' const
from
sales_product
where
(region not in ('15876','15852')) and
(prodtype in ('4','7','50','1')) and
(recevdate >= ('01/01/' || (year(?) - 1))) and
(recevdate <= Date('12/31/' || (year(?) - 1)))
group by 1,2,3,5,6,7
如果您查看 where 子句,您会看到我从参数中获取年份,然后将其添加到字符串月份和日期中。这里的问题是'||'运算符直接在 Informix 中工作,而不是通过 ODBC。当我执行这个查询时,我得到一个语法错误。有没有其他方法可以连接两个字符串?
【问题讨论】:
标签: reporting-services odbc reportingservices-2005 informix