SELECT DISTINCT

seand

New Member
Joined
Apr 13, 2004
Messages
15
Hi Everyone :p I really need help with a SELECT DISTINCT query. I have one table called Loans and in that table I need to select unique loan numbers from the "LoanID" column" but still need to list all other columns in the table here is my query

SELECT DISTINCT dbo_Liabilities.LoanID, dbo_Contacts.ShowAsName, dbo_CTRL_Lender.Lender, dbo_Liabilities.InitialPrincipal, dbo_Liabilities.Status, dbo_Liabilities.DateCommenced, dbo_AssetOwners.OwnerName
FROM (dbo_CTRL_Lender INNER JOIN dbo_Liabilities ON dbo_CTRL_Lender.ID = dbo_Liabilities.LenderLkp) INNER JOIN (Advisers INNER JOIN (dbo_AssetOwners INNER JOIN dbo_Contacts ON dbo_AssetOwners.ContactID = dbo_Contacts.ContactID) ON Advisers.ContactID = dbo_Contacts.OwnerID) ON dbo_Liabilities.LoanID = dbo_AssetOwners.AssetID
WHERE (((dbo_Liabilities.Status)="Application Pending"));

But is till return duplicate "LoanID" as this loan is linked to more than one person but I only want this loan to show up once, **PLEASE** help me :oops: questions welcome, many thanks.
 
WOW ! thanks for your effort, I see where you are going and I have tried to modify the code to the correct tables and names but with no success :oops: . I was trying to get an idea of where I should be going but I think it would be better to email you a screen dump of my tables to give you idea and the relationships between tables, I have is a screen dump of my tables and how they are related. I think we are just about there, could I email this? I am new to this board so I don't know whether I can upload the screen sump into this message it is only 96KB thanks [/img]
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,221,680
Messages
6,161,248
Members
451,692
Latest member
jmaskin

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