I am running a query to test whether or not a street entered by the user already exists in my database.
The trouble is this: in the database, the names are listed as "127TH" and "21ST" instead of "127" and "21".
So, as you might be able to guess, if the user enters "127", I need to insure that I am querying all the streets which have "127TH". If the user enters "122", and this street does not exist in the database, I need to add "122ND" (and not "122"
.
Any ideas on the best way to handle this. I will assume that I would need to add some kind of logic to differentiate between 1 (which ends with a "ST"
, 2 (which ends with a "ND"
, 3 (which ends a "RD"
, and 4-0 (which ends with a "TH"
.
The trouble is this: in the database, the names are listed as "127TH" and "21ST" instead of "127" and "21".
So, as you might be able to guess, if the user enters "127", I need to insure that I am querying all the streets which have "127TH". If the user enters "122", and this street does not exist in the database, I need to add "122ND" (and not "122"
Any ideas on the best way to handle this. I will assume that I would need to add some kind of logic to differentiate between 1 (which ends with a "ST"