troubleshooting Question

SQL, How to do filter out

Avatar of tanj1035
tanj1035 asked on
Microsoft SQL Server
5 Comments2 Solutions67 ViewsLast Modified:
Hi Experts

My query below returned the result (see the screen shot). I want to only showing the result if loanstoreID<> transactionlocationstoreID.
For example, I want to show the result of loanID 1330114, not loanID 418282, 418323 etc...

How do I modify my query?

Thank you

select ln.loanID, ln.loanstoreID, lt.transactionlocationstoreid, ln.loandate, lt.transactiondatetime, lt.transactionamt
from tblLoans ln inner join 
tblLoanTransactions lt on ln. LoanID = lt. LoanID
where lt.TransactionTypeID=9 
and lt.TransactionLocationStoreID in (select StoreID from tblStores_tblStoreTypes where storetypeID=1)
Brian Crowe
Database Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2005

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 2 Answers and 5 Comments.
Start Free Trial
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 5 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