![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've got an Access 2007 table with a field called Zip which is a text field. Some zips were entered like "67203" and others like "67203-2752". Is there a way to format a criteria statement in a query to pull all zips between "67203" and "67203" without having to resort to something like between "67203" and "67203-9999" or between "67203" and "67204"? Thanks |
#3
| |||
| |||
|
|
You could use * *LIKE "67203*" If you want a range you are going to have to use something like WHERE Zip >= "67203" AND Zip < "67204" Or you can use the Val function and then number values (at a cost in efficiency and speed) WHERE Val(ZIP) Between 67203 and 67203 Or you can use (at a cost in efficiency and speed) WHERE LEFT(Zip,5) Between "67203" AND "67203" John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County emanning wrote: I've got an Access 2007 table with a field called Zip which is a text field. *Some zips were entered like "67203" and others like "67203-2752". *Is there a way to format a criteria statement in a query to pull all zips between "67203" and "67203" without having to resort to something like between "67203" and "67203-9999" or between "67203" and "67204"? Thanks- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
You could use LIKE "67203*" |
|
If you want a range you are going to have to use something like WHERE Zip >= "67203" AND Zip < "67204" |
|
Or you can use the Val function and then number values (at a cost in efficiency and speed) WHERE Val(ZIP) Between 67203 and 67203 Or you can use (at a cost in efficiency and speed) WHERE LEFT(Zip,5) Between "67203" AND "67203" |
![]() |
| Thread Tools | |
| Display Modes | |
| |