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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If a data field has five characters...

Status
Not open for further replies.

brendanDATA

Technical User
Jan 6, 2005
2
US
I am trying to insert data into a new table if the record has a five character zip code. It doesn't matter what the zip is, it just has to have five characters. I have the rest of the query, I just don't know what the where would look like to say where a field has five characters in it. Anyone have ideas?
 
where Len(field) = 5

or if there are spaces you want to remove...

where len(replace(field, ' ', '')) = 5

I'm not 100% sure of the syntax for replace though...

--------------------
Procrastinate Now!
 
Or len(trim(field)) = 5 if there are no embedded spaces.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top