I am writing a very advanced search for a real estate listing database.
Right now the processor is pretty simple, basically it builds the query while it checks for what fields are chosen.
If a user searches by zip code, there is a problem, the database, which I cannon change the structure of, as it is a regional database, has SOME zip codes in +4 format (meaing 12345-6789)
I dont want to have the user enter a +4 zip code, and the database is so large that I dont want to have a separate query to sift through the zip codes before it does another query for the rest of the search.
Is there a way to, inside the query, compare to only the first 5 digits of the data inside the database for the zip code field.
Also, which is much LESS important...does anyone know enough about zip codes for the query to also return listings for the zip codes of bordering towns?