posted 7 years ago
That's a lot of code and data you're asking us to go through, but not a very helpful problem description, I'm afraid.
Please post both input that works and input that doesn't work, and post the SQL entries for just those two examples. The one you mentioned (B91829UXY) isn't in the list, for example. And if you don't expect people to type the space character, then you need to account for that when retrieving values from the DB (which mostly seems to have those spaces).
You might also want to account for people typing just the number, without the leading letter, but that's an enhancement for when you got the basics working.
Lastly, the DB has a couple of entries that have a leading space character - a mistake or by design?