Enter department head with a broken, home grown, web app.
Department head speaks:
"We fired the guy that wrote this two years ago, please fix it"
Exit department head

Me opens the source to see whats what.

below are comments at the top of the asp page.....

If you think this is funny you should see some of the stored proc's



'# GLOBAL VARIABLES ############################################################
I'm sorry that you are stuck looking at this. It is another one of those demo programs that went too far! I should have written down the user requirements, statements, and assumptions and had the user group sign it. Requirements were different depending on the person that you were talking to. Some of the SQL calls are weird as is the the database setup. I was initially told that we need to track history and that layouts are reused. This isn't really true. We want to get the most recent records for most db calls which is done by querying the status that you want and selecting the IsCurrentRecord = 1. Getting a recordset of completed layouts gives you a problem because layout_proj_id = 20 can have version A, B, C, and D all completed this week and the draftsperson has then completed four layouts with a item count of the total * 4. So we select distinct versions for each layout_proj_id and version that match the queried criteria and get the max timestamp...