Message-ID: <5236385.1075854987334.JavaMail.evans@thyme>
Date: Mon, 1 Oct 2001 13:04:20 -0700 (PDT)
From: matt.smith@enron.com
To: david.woodstrom@enron.com
Subject: RE: VIEW
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-From: Smith, Matt </O=ENRON/OU=NA/CN=RECIPIENTS/CN=MSMITH18>
X-To: Woodstrom, David </O=ENRON/OU=NA/CN=RECIPIENTS/CN=Dwoodstr>
X-cc: 
X-bcc: 
X-Folder: \MSMITH18 (Non-Privileged)\Sent Items
X-Origin: Smith-M
X-FileName: MSMITH18 (Non-Privileged).pst

Come by and I'll show you where it is.

Mat

 -----Original Message-----
From: 	Woodstrom, David  
Sent:	Monday, October 01, 2001 2:14 PM
To:	Dronet, David
Cc:	Smith, Matt
Subject:	RE: VIEW

Matt,
dbo.MOD_Load table does not exist in the Fundamentals database on the Portland server. Any ideas?

 -----Original Message-----
From: 	Dronet, David  
Sent:	Monday, October 01, 2001 1:14 PM
To:	Woodstrom, David
Cc:	Smith, Matt
Subject:	FW: VIEW

Dave, 
	Since you've already gotten the connection built to portland could you created this for Matt?

Dave

 -----Original Message-----
From: 	Smith, Matt  
Sent:	Monday, October 01, 2001 1:09 PM
To:	Dronet, David
Subject:	VIEW

Dave,

Hey,  can you create a view for me on Portland's database.  The SQL code is below.  Let me know if you need anything else.

Mat



SELECT     dbo.MOD_Load.DateTimeValue, dbo.LkpCalendar_Definitions.DateValue, dbo.LkpMOD_Scenario.ScenarioCode, dbo.LkpMOD_Region.RegionCode, 
                      AVG(dbo.MOD_Load.Load_MW) AS [Ave Dly Ld], dbo.LkpCalendar_Definitions.MonthName, dbo.LkpCalendar_Definitions.DayNum, 
                      dbo.LkpCalendar_Definitions.YearNum, dbo.LkpCalendar_Definitions.DayOfWeekName, dbo.LkpCalendar_Definitions.PeakOrOffPeak
FROM         dbo.MOD_Load INNER JOIN
                      dbo.LkpMOD_Region ON dbo.MOD_Load.RegionID = dbo.LkpMOD_Region.RegionID INNER JOIN
                      dbo.LkpMOD_Scenario ON dbo.MOD_Load.ScenarioID = dbo.LkpMOD_Scenario.ScenarioID INNER JOIN
                      dbo.LkpCalendar_Definitions ON dbo.MOD_Load.DateTimeValue = dbo.LkpCalendar_Definitions.DateTimeValue
GROUP BY dbo.LkpMOD_Scenario.ScenarioCode, dbo.LkpMOD_Region.RegionCode, dbo.LkpCalendar_Definitions.DateValue, 
                      dbo.LkpCalendar_Definitions.YearNum, dbo.LkpCalendar_Definitions.MonthName, dbo.LkpCalendar_Definitions.DayOfWeekName, 
                      dbo.LkpCalendar_Definitions.PeakOrOffPeak, dbo.LkpCalendar_Definitions.DayNum, dbo.MOD_Load.DateTimeValue
HAVING      (dbo.LkpMOD_Scenario.ScenarioCode = 'BEST') AND (dbo.LkpCalendar_Definitions.DateValue BETWEEN CONVERT(DATETIME, '2001-09-01 00:00:00', 
                      102) AND CONVERT(DATETIME, '2001-12-31 00:00:00', 102))
ORDER BY dbo.LkpCalendar_Definitions.DateValue DESC, dbo.MOD_Load.DateTimeValue