Subject Why won't this sql statement find record when it exists?
Author marsh.rolf
I have this sql statement:

SELECT * from tBooks where BookNbr = '20111122-001'


BookNbr is defined as varchar (15), and the record does exist in the table. The user has populated this field with dashes in the field, sometimes multiple dashes, sometimes none.

I removed the dash and changed the field in the table, and it found the record. Therefore, I think the problem is the dash in the "key" field.

Is there a way to fix this?