The situation is more complex than this, but this has the essence of it.
Two Tables: History and Current
History has the fields: lHistoryId, lCurrentId, FieldChanged, DateChanged, OldValue, NewValue,
Current has the fields: lCurrentId, FieldA, FieldB, FieldC, FieldD
I woudl like to right a Query which shows all of the changes made during a certain period, as well as the current value for those fields.
The outpout would look something like: (FieldC changed to "TestC3" after the period being queried for)
FieldChanged OldValue NewValue CurrentValue
FieldB TestB1 TestB2 TestB2
FieldC TestC1 TestC2 TestC3
"SELECT FieldChanged, OldValue, NewValue FROM History WHERE (lCurrerntId = 123) AND (<...Date Range...>)" is the easy part, but how to get the CurrentValue?<
View Complete Post