Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Where Clause on first 3 number

Status
Not open for further replies.

bla1979

MIS
Jun 1, 2006
9
US
I have a table of zip codes, I want to be able to search by only the first 3 numbers, but I want the user to input all 5. Anyone have a clue.
 
Code:
SELECT * 
   FROM ....
   ...
  WHERE ZipCodeField LIKE LEFT(UserInputCode,3)+'%'

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top