INSERT INTO problem

[FONT=Trebuchet MS]I have a quite difficult problem and I need help!!!

I have a table and I have to insert a few hundred rows with these columns:

Email
When
What

I could make when and what with VALUES like

INSERT INTO emaillog(when, what)
VALUES (050712,P:\db\RAM Price List 070512.zip)

This is okay. The problem is with the emails. Those come from a query, I have a few thousand. So the new rows should look like this:

[email protected] 050712 P:\db\RAM Price List 070512.zip
[email protected] 050712 P:\db\RAM Price List 070512.zip
[email protected] 050712 P:\db\RAM Price List 070512.zip
[email protected] 050712 P:\db\RAM Price List 070512.zip
[email protected] 050712 P:\db\RAM Price List 070512.zip
[email protected] 050712 P:\db\RAM Price List 070512.zip

I really don’t know how to do that…

I tried…
INSERT INTO emaillog(email, when, what)
VALUES (

(SELECT email FROM ram_070515query), 050712, P:\db\RAM Price List 070512.zip)…

but it didn’t work…

PLEASE HELP ME, I don’t want to type in hundreds of rows!!![/FONT]

Are you saying that these 100 or so records are already in a table? If so, you could try this:

SELECT ? INTO
tblEmailLogs

This select statement selects all records from one table, and then creates a new table with those records in it.

Richard M.

[FONT=Trebuchet MS]The contacts are in a table, and I get out certain email addresses by a query. I need to add these emails to another table with a date and a subject.

Actually I’m using MS Access… Can you help me?[/FONT]

You would probable require to use a join between these 2 tables by matching a ceratin pattern.

Access can create a good query in design mode. You have to just select tables, establish relationshiop between them and specify the records you want.

[FONT=Trebuchet MS]OK, I’ve solved that with this:

INSERT INTO emaillog ( Email, When, What)
SELECT email, ‘20050712’, ‘P:\db\RAM Price List.zip’
FROM ram_050712query;

Thanks for the help guys![/FONT]