jarrodprice
asked on
Creating a Modification flag
I have a timestamp that tracks modifications to my records, but I want to create a flag that switches to 1 from o whenever there is a modification.
Is there a way to do this?
Is there a way to do this?
ASKER
that only works for first modification. But thats okay, I figured it out :)
if it is set to 0 at 1st mod, how could it be set to 0 again anyway?
ASKER
what I did was create a related modification table and use a script that copies the modification date to a related record in that table, whenever a new record in the first table is created.
The mod flag is set to 1 when the the dates in the related records are not the same, which only happens if the record in the first record is changed (thus changing its modification date). When the script is run again, the 2 dates match again, so the flag goes back to 0
The mod flag is set to 1 when the the dates in the related records are not the same, which only happens if the record in the first record is changed (thus changing its modification date). When the script is run again, the 2 dates match again, so the flag goes back to 0
so you wanted a latch, something which toggles, not just flip once...
you could have done this using an extra field in the same table too I think
you could have done this using an extra field in the same table too I think
ASKER
you cant, cuz as soon as you change the flag it modifies the record, thus always switching it back to modified.
true...
Take the data you want to control and make it intoa concatenated string. Run a HASH such as MD5 against it. Save the HASH in another field and then compare the current HASH to the oldif the HASHes are different the strings are almost cetainly different. one in 2 to the 67th power odds.
If you would like to learn how to do that let me know
If you would like to learn how to do that let me know
how about a split
ASKER
I am sorry, I had figured out a solution to this problem on my own.
Olease post your solution so we can close this question
Thanks
Venabili
Thanks
Venabili
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if yes, set the flag to 0 when creation timestamp is <> modification timestamp