Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query input must contain at least one table or query. (Error 3067)

Status
Not open for further replies.

Sendeman

Technical User
Apr 7, 2006
32
NL
Hi All,

I'm having some trouble with this SELECT INTO-query query I'm trying to build.

This query (Query 1) gives the error statement:
"Query input must contain at least one table or query."(Error 3067)

Query1:
Code:
SELECT tblGWS_Alle_data_tmp.BhId, [Top_Drijflaag_NAP]-[GWS_NAP] AS DikteDrijflaag INTO tblDiktesDrijflagen
INTO tblTEST
FROM (tblGWS_Alle_data_tmp RIGHT JOIN tblGWSnabijLaatsteDrijflaagmeting_tmp ON tblGWS_Alle_data_tmp.IntervalID = tblGWSnabijLaatsteDrijflaagmeting_tmp.IntervalID) LEFT JOIN tblTopDrijflaag_Alle_data_tmp ON tblGWS_Alle_data_tmp.BhId = tblTopDrijflaag_Alle_data_tmp.BhId
GROUP BY tblGWS_Alle_data_tmp.BhId, [Top_Drijflaag_NAP]-[GWS_NAP];

When I leave the INTO statement out, I get no error and the query returns the correct values (Query 2).

Query 2:
Code:
SELECT tblGWS_Alle_data_tmp.BhId, [Top_Drijflaag_NAP]-[GWS_NAP] AS DikteDrijflaag INTO tblDiktesDrijflagen
FROM (tblGWS_Alle_data_tmp RIGHT JOIN tblGWSnabijLaatsteDrijflaagmeting_tmp ON tblGWS_Alle_data_tmp.IntervalID = tblGWSnabijLaatsteDrijflaagmeting_tmp.IntervalID) LEFT JOIN tblTopDrijflaag_Alle_data_tmp ON tblGWS_Alle_data_tmp.BhId = tblTopDrijflaag_Alle_data_tmp.BhId
GROUP BY tblGWS_Alle_data_tmp.BhId, [Top_Drijflaag_NAP]-[GWS_NAP];

So, why does the INTO statement give me this error message? I do get results from the select query.

I hope any of you may have an idea. Any help will be greatly appreciated!

Best regards,
Martijn Senden.

I love deadlines. I like the whooshing sound they make as they fly by.
- Douglas Adams -
 
Whoops!

Just saw the huge typo! The code below works just fine!
Code:
SELECT tblGWS_Alle_data_tmp.BhId, [Top_Drijflaag_NAP]-[GWS_NAP] AS DikteDrijflaag
INTO tblDiktesDrijflagen
FROM (tblGWS_Alle_data_tmp RIGHT JOIN tblGWSnabijLaatsteDrijflaagmeting_tmp ON tblGWS_Alle_data_tmp.IntervalID = tblGWSnabijLaatsteDrijflaagmeting_tmp.IntervalID) LEFT JOIN tblTopDrijflaag_Alle_data_tmp ON tblGWS_Alle_data_tmp.BhId = tblTopDrijflaag_Alle_data_tmp.BhId
GROUP BY tblGWS_Alle_data_tmp.BhId, [Top_Drijflaag_NAP]-[GWS_NAP];

Regards, Martijn.

I love deadlines. I like the whooshing sound they make as they fly by.
- Douglas Adams -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top