Sorting groups of zip codes

shirkb

New member
Local time
Yesterday, 23:20
Joined
Jan 1, 2010
Messages
3
I have a query that will sort groups of zip codes using the following expression: Between [T_ZipRange]![StartZip] And [T_ZipRange]![EndZip]

The first and last zip codes are entered and the expression returns the zip codes between the "start" and "end" range. The problem is that if a zip code is only 5 digits: xxxxx- instead of xxxxx-xxxxx, the zip code will show up in other sorts. The zip code field is a text field. How can I limit the sort, based on the number of digits in the zip code?
 
if you want to "really" sort the numbers properly you have to either
1) Split out the number part into a number only field and filter on that
or
2) add a zero in front of the 5 number codes to make them fit in with the 6 number codes and adjust your filtering accoordingly if you want to find the 5 digit ones.
 
In your query, you may want to add a calculated field, ZipMain: Left([ZipCode],5) and do your sorting/filtering based on that.
 

Users who are viewing this thread

Back
Top Bottom