Agree with what Ashley said above. Since you mentioned a database, I'm betting you aren't handling the string correctly. Note that this:
2012-007
is either a string or a mathematical equation. Since you don't want the latter, it has to be the former.
As such, are you treating this string correctly in the SQL query? (Hint: all strings must be surrounded with single quotes.)