Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / September 2006

Tip: Looking for answers? Try searching our database.

Using If Statement and Alphanumeric data...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jperleevt@yahoo.com - 05 Sep 2006 20:42 GMT
I'm trying to use a nested IF statement to look at a field and return a
different value depending on the value. I have no problem that I know
of creating the actual IF statement. My problem comes from the fact
that my data is Alphanumeric....

06SUBOT    should return Summer 2006
FA2006       should return Fall 2006
2007SP       should return Spring 2006
07SUBOT    should return Summer 2007
MSSU06      should return Summer 2006

Are all examples of data that maybe in my source document, which is a
comma/quoted text file.

I dumbed it down to just a single IF statement and it still fails....

{IF {MERGEFIELD c77CcAltr11} = "06MAFW" "Summer 2006" "NOT Summer
2006"}

It works fine for the data that starts w/ letters but messes up on the
ones that start w/ numbers.

I found this article...
http://support.microsoft.com/default.aspx?scid=kb;en-us;97484
..which seems to say I'm screwed, although it is for Word97.

I'm using Word 2003 sp 2.

Anyone have any ideas? Changing my data is most likely not possible as
it is coming from another system and getting passed into a Word doc. In
the furture my users will use consistent names that start w/ alpha but
I need to come up w/ some sort of solutions as they can't easily change
what they have already done as it impact other systems as well.

Thanks for any assistance you can provide.

Jen
Peter Jamieson - 05 Sep 2006 22:17 GMT
Yes, there are some problems with matching certain values.

My suggestions:
a. make sure you fully quote the operands in the IF. I would do the
punctuatin and spacing as follows, although the quotes around the field name
really are only necessary if the name has spaces or whatever in it:

{ IF "{ MERGEFIELD "c77CcAltr11" }" = "06MAFW" "Summer 2006" "NOT Summer
2006" }
b. assuming that isn't enough (I don't think it will be), force the
operands to start with a letter instead of a digit, e.g.

{ IF "A{ MERGEFIELD "c77CcAltr11" }" = "A06MAFW" "Summer 2006" "NOT Summer
2006" }

My best bet anyway...

Peter Jamieson

> I'm trying to use a nested IF statement to look at a field and return a
> different value depending on the value. I have no problem that I know
[quoted text clipped - 33 lines]
>
> Jen
jperleevt@yahoo.com - 06 Sep 2006 01:54 GMT
Thanks Peter!
I did a small test at home and it worked! I'll try it tomorrow in my
actual document.

:-)

Jen

> Yes, there are some problems with matching certain values.
>
[quoted text clipped - 52 lines]
> >
> > Jen
jperleevt@yahoo.com - 09 Sep 2006 21:43 GMT
After a lot of futsing around I got the whole thing to work. Thanks so
much again!

> Thanks Peter!
> I did a small test at home and it worked! I'll try it tomorrow in my
[quoted text clipped - 60 lines]
> > >
> > > Jen
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.