Adding records from one table to another

R

ReidarT

I have a MemberTable, (tblMember) and a CompanyTable, (tblCompany).
The key is CompanyID

I want to add records to a third table tblCompany2.
There are several members in each company.
Companies with valid members shall be added to the new table.
How do I add these records (only companies with unique CompanyID)?

My sql is
"SELECT tblCompany.* " & _
"FROM tblCompany INNER JOIN tblMember ON tblCompany.CompanyID =
tblMember.CompanyID " & _
"WHERE (tblMember.ExpireDate)>Date()"
regards
reidarT
 
G

Guest

SELECT distinct tblCompany.* into tblCompany2 FROM tblCompany INNER JOIN
tblMember ON tblCompany.CompanyID = tblMember.CompanyID
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top