Monks,
I have a database of an inventory of keys. People check keys in and out. I'm trying to write an audit routine where I can look for errors in the database. Sometimes people check out a key, but forget to check it back in. The next time they check it out the number of keys on hand gets out of whack. I can easily search for all records that have either a negative number or more than one key on hand which is okay, but I'd like to search for all records where a check out doesn't have a corresponding check in. For example, if one key has two check ins or two check outs in a row, it would be flagged. I'm really not sure how to do this. Any ideas?