I am trying to get the most recent record for the subquery below. However, I am at a loss to get the most recent record as there are duplicates. How can I set a condition that gets the most current last modified date to make sure I am getting the most recent? Thanks.
BK_Old_Loan_Type=(Select Case When lp.ItemName='DLOLNTYPE' AND Then lp.LoanPropertyValue Else 'None' End From LoanProperty lp Join Loan ln On ln.MemberNumber=lp.MemberNumber AND ln.LoanNumber=lp.LoanNumber Where lp.ItemName='DLOLNTYPE' AND ln.LoanType='48' AND lp.ItemName='DLOLNTYPE')