Create a new table using three existing tables

Hector H

Registered User.
Local time
Today, 05:33
Joined
Jun 25, 2009
Messages
17
I need to create a new table using three existing tables. Calculations are maded.

I was able to use the SELECT INTO statement for two tables but can't do it for three.

I keep getting syntax errors. I created the new table using query design tool and copied SQL but it would not work in VB.

SELECT Case_123_Contingency.[Contingency Name], ([Case_456_Contingency]![Congestion Cost (k$)]-[Case_123_Contingency]![Congestion Cost (k$)])/1000 AS Expr1, ([Case_456_Contingency]![Congestion Cost (k$)]-[Case_123_Contingency]![Congestion Cost (k$)])/1000*[Contingency Ownership]![Computed CAISO Ownership (%)] AS Expr2

FROM (Case_123_Contingency INNER JOIN Case_456_Contingency ON Case_123_Contingency.[Contingency Name] = Case_456_Contingency.[Contingency Name]) INNER JOIN [Contingency Ownership] ON Case_123_Contingency.[Contingency Name] = [Contingency Ownership].[Contingency Name]

I tried it using where statemnet also.
 

Users who are viewing this thread

Back
Top Bottom