>The table looks like this:
>
>receiveddate;category;amount;fisyear
>There is only one record per category per month. So there is no need to sum.
>The pair of selects produces a cursor containing a column for category and each month. It looks like this:
>category;sep;oct;nov;fisyear (plus the other months.)
>This is exactly what I want except I only get the first fisyear. What I would like to do now is add a second set of records to the result for the second fisyear and a third set of records for the third fisyear an so on. I could do this by creating an empty result cursor and then appending the results into it while SCANing through the fisyears but I thought there might be a way to accomplish it with just the SELECT.
Try
select sum(iif(Month(receiveddate)=1,Amount,000000000000)) as Jan, ...., FisYear,
Category group by FisYear, Category
Actually, looks like this select alone will give you what you want.
If it's not broken, fix it until it is.
My Blog