pelton wrote:
I wanted to stay away from using "From and Thru" dates because then when you add a row you have to inactivate the prior row. But this might be easier than I thought, so I am going to look into it.
Well, it's quite involved, but if you keep your logic clean, then it can certainly be done. You will have to have a few extra columns though. A lot depends on if you want to have an authorization mechanism inside of it.
Say you have a row that depicts a certain attribute (say 'name': x) from 1/1/2000 to 31/12/2000 and then someone decides to insert a new state (:y) of the attribute from 1/5 to 1/6. Then you should end up with 3 rows in the database:
1/1 till 31/4 name = x
1/5 till 1/6 name = y
2/6 till 31/12 name = x
Now, if the first row (1/1 till 31/12) was an authorized row, you would also still have that row, but with a column stating it is 'old'. So:
1/1 till 31/12 name = x, row is old.
1/1 till 31/4 name = x, row is new.
1/5 till 1/6 name = y, row is new.
2/6 till 31/12 name = x, row is new.
Then this new situation is approved by someone with the power to do so. At that point the situation is:
1/1 till 31/12 name = x, row is superseded.
1/1 till 31/4 name = x, row is valid.
1/5 till 1/6 name = y, row is valid.
2/6 till 31/12 name = x, row is valid.
If you also log the datetime WHEN that state change and the person who approved and inserted, you will be able to exactly replay all the actions taken in the system and have an incredible auditing system.
Good luck!