I am building a report in Reporting Services 2005, where the data is retrieved from an Informix database. The connection to the database is declared via ODBC. Here is the simpler version of the query:
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
If you look at the where clause, you will see that I am taking the year from the parameter and then adding it to a string month and day. The problem here is that the '||' operator works directly in Informix, but not over ODBC. When I execute this query, I get a syntax error. Is there any other way to concatenate two strings?