Hello.
I have 2 tables, tblLHFIedit and tblconchargeoff. tblLHFIedit is a cumulative table that has multiple months of data stored in it and tblconchargeoff is a temporary table that only stores the most current month's data.
I am looking to create an update query to update tblconchargeoff with a field from tblLHFIedit, UPB, with the most recent date. There may be multiple months where the same record will appear in tblLHFIedit, but I want to pull in the value that comes from the most recent month. Is there any way to do this? I tried creating a query but I am not sure if it is pulling in the most recent value or which date it is pulling from.
Any help with edits to the following query would be appreciated! Thanks so much!
I have 2 tables, tblLHFIedit and tblconchargeoff. tblLHFIedit is a cumulative table that has multiple months of data stored in it and tblconchargeoff is a temporary table that only stores the most current month's data.
I am looking to create an update query to update tblconchargeoff with a field from tblLHFIedit, UPB, with the most recent date. There may be multiple months where the same record will appear in tblLHFIedit, but I want to pull in the value that comes from the most recent month. Is there any way to do this? I tried creating a query but I am not sure if it is pulling in the most recent value or which date it is pulling from.
Any help with edits to the following query would be appreciated! Thanks so much!
Code:
'Add UPB to tblconchargeoff
strSQL = "UPDATE tblconchargeoff INNER JOIN tblLHFIedit ON (tblconchargeoff.[Loan Number] = tblLHFIedit.[Loan Number]) " _
& "AND (tblconchargeoff.Month = tblLHFIedit.[Month]) SET tblconchargeoff.[UPB] = [tblLHFIedit].[Total Current];"
DoCmd.RunSQL (strSQL)