[QUOTE=kafecadm;33921]To give you a better answer I’ll need you to provide the error message, tho, I think your problem is actually the way you building the query, those +1 and +2 are messing you up.
instead of that in the onapplicationinit of your report write some code like this.
[YEAR1]= [YEAR] + 1;
[YEAR2]= [YEAR] + 2;
Then modify your query to be something like this:
SELECT order_id,
SUM(CASE WHEN YEAR(order_date) = [YEAR] THEN order_count ELSE 0 END) AS [YEAR],
SUM(CASE WHEN YEAR(order_date) = [YEAR1] THEN order_count ELSE 0 END) AS [YEAR1],
SUM(CASE WHEN YEAR(order_date) = [YEAR2] THEN order_count ELSE 0 END) AS [YEAR2]
FROM order_history
GROUP BY
order_id
Regards[/QUOTE]
i tried to do like above i still get error
Invalid argument supplied for foreach() | Script: C:\Program Files\NetMake\v8\wwwroot\scriptcase\devel\compat
m_select_atualiza.php
and Error while accessing the database:
Also when i rewrite my SQL like it was before it keep giving me the same error “Error while accessing the database”, it will not run until i delete the grid and make another 1 ( is it bug )?
regards