Jump to content

Inner Joins - Multiple Criteria


ameliabob

Recommended Posts

I am trying to find away to do a search to find matched records. I have put together the following code

Dim sleuths As Recordset, newsleuths As RecordsetDim qry As StringDim dbs As DatabaseDim ctr As Integer, ans As Recordset    ctr = 0    Set dbs = CurrentDb    qry = "SELECT * FROM NewSleuths JOIN SLEUTHS ON NewSleuths.FirstName=SLEUTHS.FirstName AND NewSleuths.LastName = SLEUTHS.LastName"    Set newsleuths = dbs.OpenRecordset(qry, dbOpenDynaset)

When I try to execute this I get a message that there is an error in the FROM clause. Can I not have an AND condition in the ON?

Link to comment
Share on other sites

you need to specify the column names instead of wild card (*)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...