zipcode query

slimjen1

Registered User.
Local time
Today, 15:39
Joined
Jun 13, 2006
Messages
562
All, I am using Access 2003 I have a table with zipcodes and the data type is text. Some of the zipcodes were entered incorrectly. In a query, I need to use "Trim" because there are leading and trailing spaces surrounding the zipcodes also I need to get those problem zipcodes where they don't equal the length of 5 like:99999 or format the 9 digit zipcode format like: 99999.9999.
I tried:
Code:
not like "*****.****" and not like Len([Zipcode])>5
I keep getting "" around the 5 and it doesn't list all the problem zipcodes. How can I get just the problem zipcodes?
Thanks
 
I think in both parts of the "and" you have to refer to the zip code field

so it would be something more like this:

[Zipcode] not like "*****.****" and [Zipcode] not like Len([Zipcode])>5

I'm not hundred percent sure that "not like" is the correct term, I usually use "<>"
 
thank you i'll try this
 

Users who are viewing this thread

Back
Top Bottom