In the above FldID 52 = Description and FldID 54 = HistoryDetail
For any given date the output should be the last entry for that date. Also the columns need to be become rows. User will provide 2 dates. Say March 2, 2010 and March 3, 2010.
So output in above case should be
Since Rev 6 does not have an entry for FldID 52 in Table A, [Placeholder 1] should have Words from Rev 3 (since that is the latest before Rev 6 for FldID 52 in Table A).
Similarly,
Since Rev 6 does not have an entry for FldID 54 in Table A, [Placeholder 2] should have Words from Rev 5 (since that is the latest before Rev 6 for FldID 54 in Table A).
Since Rev 8 does not have an entry for FldId 54 in Table A, [Placeholder 3] should have Words from Rev 7 (since that is the latest before Rev 8 for FldID 54 in Table A).
I am unable to come up with a query that can give me the above results. Please help.
update
Datatypes for fields in TABLE B