troubleshooting Question

how to join matching records into 1 line?

Avatar of developingprogrammer
developingprogrammer asked on
Microsoft Access
23 Comments2 Solutions486 ViewsLast Modified:
hi guys,

i've got a super intriguing SQL question to ask - at least for me it's tremendously interesting.

i've got a query that produces data for reconciliation. (kindly see attached excel sheet here joining.xlsx)

in it i have some credits that have a matching debit and some that don't. the 2 yellow rows in the below picture show a match.
the rules are that for 2 records to match, their:
1) PhysicalSettlementPeriodRowID must be the same
2) Credit and Debit must be the same (though they're on different lines)
3) Source must be different
4) ReconciliationAccountID must be the same
5) MachineID must be the same

so i've got 2 matching records as shown in the yellow highlight. how do i join these 2 into a single table that shows this?

end result
the matched records are on 1 line and the unmatched records are as per normal also on one line?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 23 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 23 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros