Extract text based on an IIF

  • Thread starter Thread starter sherriross81
  • Start date Start date
S

sherriross81

Hello,

I have this statement

Zip: IIf(Len([zip])>5,Left([zip],5) & "-" & Mid([zip],6,15))

Some of my data is the normal 5 digit zip and some has additional digits
after it. If its greater than 5 digits I want to insert an hyphen if not I
just want to display the zip. I got the logic to insert the hyphen down but
when I try to tell it to otherwise just display [zip] it just keeps telling
me I have the wrong number of arguments no matter where I put it.

Any ideas?
 
Nevermind I got it to work here is my completed code if anyone else couuld
use it...

Zip: (IIf(Len([zip])>5,Left([zip],5) & "-" & Mid([zip],6,15),[zip]))
 
Back
Top