Access Extract data from other tables

virtualkunal

New member
Local time
Today, 02:37
Joined
Feb 10, 2011
Messages
1
I am trying to pull data from 2 tables and put into a new table..
this is how my query looks..


INSERT INTO SAMPLE ( Collection_Date, Collection_Time, Method_Name, Comment_Station_Location, Comments_Use_Impairment_Status, Comments_Land_Use, Comments_Biota_Habitat, StationKey )
SELECT [PA Station].[Collection Date], [PA Station].[Collection Time], [PA Station].[Full Method Name], [PA Station].[Comments - Station Location], [PA Station].[Comments - Use Impairment Status], [PA Station].[Comments - Land Use], [PA Station].[Comments - Biota / Habitat], STATIONS.StationKey
FROM [PA Station], STATIONS
WHERE STATIONS.StationID = [PA Station].StationID;

I am trying to pull data from tables [PA Station] and STATIONS and put into SAMPLE table. The WHERE clause states that if STATIONS.StationID = [PA Station].StationID; then extract the StationKey from STATIONS table.

StationKey is a foreign key in the SAMPLE table which refers to STATIONS table.

The problem is Access keeps asking for entering the parameter for PA Station.StationID. Please help.
 
Put a RELATIONSHIPS between the "STATION" and "PA Station" tables.
You dont need a WHERE clause.
 

Users who are viewing this thread

Back
Top Bottom