Click here to Skip to main content
15,886,519 members

Response to: how to search record with last digits of ID number

Revision 2
ryan is right, if it's a string, you can use a LIKE clause. If it's a digit, you will have to write SQL that turns it in to a string so you can use a LIKE clause ( assuming that works ). Otherwise, you're stuck. One possibility, if you were searching for 351, you could do where x % 1000 = 351. That would be if you divide x by 1000, 351 is the remainder. so if you were searching for a two digit number, it would be % 100, etc.

Having looked again, you're clearly storing a string, so searching x LIKE '%100' is what you need.
Posted 14-Nov-12 10:54am by Christian Graus.
Tags: ,