cricketbird
Registered User.
- Local time
- Today, 06:48
- Joined
- Jun 17, 2013
- Messages
- 118
The main tables in my database have corresponding history tables. When records are changed, an insert query copies the entire changed record (table row) over to a new row in the correpsponding history table plus additional columns for DateChanged and WhoChanged that are autofilled.
For example, the history table for a table containing three fields: ItemID, ItemName, ItemPrice would have:
TblItems_History (design)
DateChanged
WhoChanged
ItemID
ItemName
ItemPrice
TblItems_History (datasheet)
10/1/2013 Bob 164 Apples $1.00
10/2/2013 Jane 164 Apple $1.00
10/3/2013 Sam 164 Apple $1.50
I want to generate a report that tells me which fields changed each day:
Basically, I think I need to take the difference between the most recent two changes for each item, but am not sure how to get that, or how I would take the results of that query and generate the appropriate report.
Does anyone have an example of how they would do this or an idea for an approach?
Thank you!
CB
For example, the history table for a table containing three fields: ItemID, ItemName, ItemPrice would have:
TblItems_History (design)
DateChanged
WhoChanged
ItemID
ItemName
ItemPrice
TblItems_History (datasheet)
10/1/2013 Bob 164 Apples $1.00
10/2/2013 Jane 164 Apple $1.00
10/3/2013 Sam 164 Apple $1.50
I want to generate a report that tells me which fields changed each day:
- On 10/2, Jane changed the ItemName from Apples to Apple
- On 10/3, Sam changed the ItemPrice from $1.00 to $1.50
Basically, I think I need to take the difference between the most recent two changes for each item, but am not sure how to get that, or how I would take the results of that query and generate the appropriate report.
Does anyone have an example of how they would do this or an idea for an approach?
Thank you!
CB