Don't really know how to explain my issue, but here is the problem. I would prefer to get this cracked so that I have the report I want with one SQL statement instead of fudging it with programming.
I have a table called hnpWorkPack with WoPa_ID | WoPa_Title fields. Each work Pack can have lots of different revisions, therefore I want MAX(WoPa_ID), WoPa_Title.
I have another table called hnpWorkPackClassEstimate, with WoPa_ID, WPCE_Year, WPCE_Grade.
The report I want is MAX(WoPa_ID), WoPa_Title, WPCE_Grade2010, WPCE_Grade2011, WPCE_Grade2012
Here is my attempt which is about as close as I can get it. It brings up the correct data in a way, however it brings up a row for each grade value.
CASE WHEN c.WPCE_Year = 2010 THEN c.WPCE_Grade ELSE '' END As Class2010,
SELECT CASE WHEN c.WPCE_Year = 2011 THEN c.WPCE_Grade ELSE
View Complete Post