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

IIF Character Count

Status
Not open for further replies.

nyucknyucknyuck

Technical User
Jan 29, 2008
14
US
For some reason all of the zip codes that begin with zero have been imported into my database WITHOUT the zero.

I don't know SQL, I use the MS Access query builder; I am trying to write a query That says (using the IIF statement

IIF zip code is less than 5 digits/characters then "0"&[ZipCode]

But I don't know the function to use.

Thanks in advance!
 
dont use iif
use

Code:
format(zipcode,"00000")
 
FYI Found it in another post.

IIF(Len([PostalCode])=4,"0"&[ZipCode],[ZipCode])


 
pwise (Programmer) ,

I have some 10-digit zips in the dbase, so I had to look only at the 4-char count.

Thanks anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top