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.
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.