Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Duplicate Records

Status
Not open for further replies.

mikefight

Programmer
Feb 2, 2007
14
CRXI r1
I have an SQL Database with a Name table and a loan table. I have dropped in the name table twice and the loan table twice. I have a left outer join with the name.SSN = name_1.SSN and name_1.AcountNumber != name.AccountNumber and a left outer join on from the name tables to the loan tables with the account numbers.

I get duplicate output.
Name Loan.ID Loan_1.ID
Bob 1 1
Bob 1 2
Bob 2 1
Bob 2 2
Bob 3 1
Bob 3 2

I want to get
Name Loan.ID Loan_1.ID
Bob 1 1
Bob 2 2
Bob 3


Then I want to total the loan balances for the ones shown.
 
I dont understand why you are dropping both or either table in twice but I think that could be the reason you are getting dupes. Why are you not just adding the tables once each, link them by account number?

_____________________________________
Not the brightest
Crystal Reports XI Developer Version
user in the world........
 
I need to link the Name.SSN to get the account numbers of the loans that need to be added. A member can have more than one account with loans on every account. I need total loans for the SSN even on multiple accounts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top