That doesn't look right. I'm not sure what you are trying to do with the value:
"".substring(record_number,6,4) = ((isset($_POST["UpdateYear"]))?$_POST["UpdateYear"]:""
Where does the UpdateYear posted value come in?
I would think it would be something like:
$UpdateQuery->addFilter("record_number", "=", "s", "".substring(record_number,6,4) ."");