View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Mail merge .. . If Then Else

And do test the result of {Mergefield PatientCode} without a condition to
ensure it reproduces exactly what you think it should reproduce. Try also

{ IF { MERGEFIELD PatientCode \*Upper} = "XX" "@" }
--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Peter Jamieson wrote:
1. Are all the {} the special field code braces that you can insert
using ctrl-F9?
2. Is the value definitely XX and not xx, xX etc?
3. Try adding double quotes around the { MERGEFIELD } field, i.e.

{ IF "{ MERGEFIELD PatientCode }" = "XX" "@" "" }

Peter Jamieson
wrote in message
oups.com...
On 8 Feb, 15:33, wrote:
Hi - i am having a few problems with the if then else conditional
statement with word mail merge. The logic that i am looking to
implement is if Value X = XX then print @ else print nothing. The
code is below. Now this seems very simple but for some reason
doesnt work and even when the condition is met it does not print @.
As part of the testing i have printed to screen Value X to confirm
it contains the data for the condition to be met but it doesnt
write the @. { IF { MERGEFIELD PatientCode } = "XX" "@" "" }


So the issue i have is that although the condition seems to have been
met it does not execute the correct part of the conditional
statement. The data being used for the mail merge comes from a SQL
2000 SP3a database.