Adding records from one table to another

  • Thread starter Thread starter ReidarT
  • Start date Start date
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
 
SELECT distinct tblCompany.* into tblCompany2 FROM tblCompany INNER JOIN
tblMember ON tblCompany.CompanyID = tblMember.CompanyID
 
Back
Top