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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access query make table problem

Status
Not open for further replies.

maverickmonster

Programmer
May 25, 2004
194
GB
I have an query as follows

Code:
INSERT INTO tbl_all_Alpha_new_final 
SELECT *
FROM 10

there is a field in the tbl_all_alpha_new_final called source_file which is the last field in the table, i wish to insert a string in to this like "10" to indicate where the information has come from, i have tried this
Code:
INSERT INTO tbl_all_Alpha_new_final 
SELECT *, 10, 10
FROM 10

but the error comes up "No destination field name in INSERT INTO statement (10)
 
Access seems to be a little more touchy so you have to put the field name that you want to insert the data into like this:

Code:
INSERT INTO wClaim ( claimid )
SELECT "ABCDEFG" AS Expr1
FROM wClaim;

Note the (claimid) is where the data from Expr1 is being placed. In your query builder, you will have to go to each field and do that instead of just using the *.
 
there is a field in the tbl_all_alpha_new_final called source_file which is the last field in the table, i wish to insert a string in to this like "10"
Something like this ?
INSERT INTO tbl_all_Alpha_new_final (source_file) VALUES ('10')


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top