First off this is not my database I am just fixing a report. I have two tables with following relevant fields.
Table 1 AR_Detail
Fields AR_Detail_Id, P_Id, Trans_Type, Posting_Stamp
Table 2 Assessed_Values
Field Value_Id, P_Id, History_Id, Assessed_Value, Change_Date
Their only related field is P_ID. This report is pulling the AR_Detail records where Trans_Type is 'avc' and I need the Assessed_Value that is the first record where Change_Date is >= Posting_Stamp.
The problem I am having is someone entered a wrong assessed value change and then made a correct assessed value change and I can't get the AR_Detail record and it subsequent Assesed_Values record to match up.
I can make a View or Stored Procedure for the report source.
Table 1 AR_Detail
Fields AR_Detail_Id, P_Id, Trans_Type, Posting_Stamp
Table 2 Assessed_Values
Field Value_Id, P_Id, History_Id, Assessed_Value, Change_Date
Their only related field is P_ID. This report is pulling the AR_Detail records where Trans_Type is 'avc' and I need the Assessed_Value that is the first record where Change_Date is >= Posting_Stamp.
The problem I am having is someone entered a wrong assessed value change and then made a correct assessed value change and I can't get the AR_Detail record and it subsequent Assesed_Values record to match up.
I can make a View or Stored Procedure for the report source.