Extract text based on an IIF

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?
 
S

sherriross81

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]))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top