Colin,

Per our conversation, I have outlined Keith's task for the team....

Background:  Portland maintains in their database a table called "PlantOutage".  Records in that table each contain an outage "BeginOutageDate", "EndOutageDate", "CapacityOut" and "OutageReason".  Records also include a PlantID (key field for PlantCharacteristics table) and a PlantUnitID (key field for Unitcharacteristics table).  The PlantCharacteristics table contains a "WSCCRegion" field and the Unitcharacteristics table contains a "Fuel_Designation" field.  

Portland has a stored procedure that for a specified date range can calculate for each date the sum of "CapacityOut" for all outage records where the date falls between the "BeginOutageDate" and the "EndOutageDate".  I have inlcuded the results of this storaged procedure in the attached file.  Our task is similar but requires more detailed subgrouping of the data.

Objective:  The objective is to return the Sum of "CapacityOut" by each possible subgrouping for each day in a range (say 1/1/2000 to 1/1/2001).  There are roughly five possible parameters for "Fuel_Designation", seven for "WSCCRegion", and two for "OutageReason".  The resulting query would return approximately 70 values for each day within the specified range.

Format:  Ultimately we will have the date in one excel sheet with dates down the left and each of the 70 sub groupings across the top.  It would be most convenient if the results of the query were formatted in this way.  Alternatively, we can use a pivot table if the results of a list query are provided.  If the second option is used, we will need to get the data in two separate lists since excel can only hand 65,000+ rows.  In this case, we would use the "OutageReason" grouping (which only has two parameters) to split out the two lists.  


Thanks for your help.

Mat