Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Mail Merge

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 10-09-2017, 03:09 PM
peterkp peterkp is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Jun 2014
Posts: 12
peterkp is on a distinguished road
Default Conditional field doesn't evaluate as expected

I have a conditional field that looks like this:
{ If {Mergefield PaySource } = “1201710P” “Your extra gift” “Your gift” }

When I update the internal field I am looking at this:
{ If 1201710 = “1201710P” “Your extra gift” “Your gift” }

When I update the conditional field I get “Your extra gift”. So it appears that Word is treating 1201710 and 1201710P as equal in value.

The PaySource can have about 6 different values. One will be 1201710. The others will all be that number with a letter suffix added. Any advice on what I am doing wrong and how to revise the field will be much appreciated.
Reply With Quote
  #2  
Old 10-09-2017, 04:29 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

If you want to test for the P, you could simply use:
Your {IF{MERGEFIELD PaySource }= "*P" "extra "}gift
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #3  
Old 10-09-2017, 05:23 PM
peterkp peterkp is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Jun 2014
Posts: 12
peterkp is on a distinguished road
Default

Thanks Paul for your prompt reply. Thanks also for your suggestion which seems to have done the trick for me. But although I see how yours works, I don't see why my version doesn't. Are you able to explain why Word is evaluating the two conditions differently?
Reply With Quote
  #4  
Old 10-09-2017, 05:38 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Basically, the issue is that the evaluation with the number prefix on both sides treats the mergefield and comparison string as numeric.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #5  
Old 10-09-2017, 06:06 PM
peterkp peterkp is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Jun 2014
Posts: 12
peterkp is on a distinguished road
Default

OK. I don't really understand why it would do that, because it effectively means Word is not comparing the actual values involved. But then, who am I to debate the subject!

More importantly, I've learned something new and you've answered my question. Much appreciated. So can you finish by pointing me to the "Solved" button for this thread?
Reply With Quote
  #6  
Old 10-09-2017, 06:07 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,199
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

Quote:
Originally Posted by peterkp View Post
So can you finish by pointing me to the "Solved" button for this thread?
It's accessed via the 'Thread Tools' dropdown. Done.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Tags
conditional, merge fields

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Field CKTisdale Word 1 04-10-2015 02:41 PM
Conditional format a button based off a value in a field Triscia Misc 0 03-11-2015 11:12 AM
Conditional formatting in custom field Puddlerunna Project 6 11-05-2014 06:14 AM
Calculated field in PivotTable not doing as expected marketshare Excel 2 10-17-2013 02:05 AM
Word Doesn't Convert Non-Unicode Characters As Expected fitchkd25 Word 1 08-17-2012 12:24 AM


All times are GMT -7. The time now is 07:31 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft