I want to pull back information about a loan. One piece of information is a certain fee amount. If I simplify my query down to the loan number and fee amount, I still can not figure it out. The first query returns what I expect, one loan number and a 0 for the fee amount (fee was not applied) while the second one I can not get to work for love nor money. It will only return an empty results set no matter what type of join I try to apply. Using SQL Server 2005 if that makes a difference.
thanks for your time.
cheers bob
select
tblLoan.loanID as LoanNumber
,isnull(tblgfe1300.gfe1300feeTot,0) as RepairFunds
from
tblLoan
LEFT JOIN tblgfe1300 on tblgfe1300.loanID = tblLoan.loanID AND tblgfe1300.gfe1300FeeName = 'Escrow Holdback'
WHERE tblLoan.loanID = '3250000167'
Now this is the one that does not work.
select
tblLoan.loanID as LoanNumber
,isnull(tblgfe1300.gfe1300feeTot,0) as RepairFunds
from
tblLoan
LEFT JOIN tblgfe1300 on tblgfe1300.loanID = tblLoan.loanID
where
tblLoan.loanID = '3250000167'
AND tblgfe1300.gfe1300FeeName = 'Escrow Holdback'