Problem pulling unique records

kmclane

New Member
Joined
Apr 1, 2004
Messages
42
I have a query that is pulling data from four different tables. For some reason it is returning multiple rows for the same records. Here is my SQL Statement
Code:
SELECT Qry_ExportSQL.ID, AgentSortCode.CBLAgentNumber, AgentSortCode.AgentName, Qry_ExportSQL.[Date/Time], Qry_ExportSQL.Material, matcost.Cost, Qry_ExportSQL.[Merchant Number]
FROM matcost INNER JOIN (EOMVisaMC INNER JOIN (Qry_ExportSQL INNER JOIN AgentSortCode ON Qry_ExportSQL.ID = AgentSortCode.ID) ON EOMVisaMC.Sort = AgentSortCode.SortCode) ON matcost.Matcode = Qry_ExportSQL.Material;

I have an autonumber field included, but I cannot for the life of me figure out how to limit the records returned. Could someone help out please.

Thanks, Ken
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I was never good at ready other people's SQL code, but here are a few things that may help:

Make use of "SELECT DISTINCT" instead of "SELECT" to return only unique rows. I am not sure if it will work with the links you have.

Another option I use when using Access's query builder is Group the records and return the First of each grouping.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,221,691
Messages
6,161,309
Members
451,696
Latest member
Senthil Murugan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top