#1
|
|||
|
|||
Using AND in field codes for two mergefields
Hi there,
I'm having problems making my merge fields condition based on two requirements. I want a couple of text to show if the city is Quebec and if there is a receipt number and another kind of text to show if the city is not quebec and the receipt is not blank. If there is no receipt number at all then a different text would show. I've tried the combination below but it keeps showing what it would show if it was quebec and receipt combination only. Any help would be greatly appreciated. TIA |
#2
|
||||
|
||||
Try something based on:
{IF{MERGEFIELD City}= "Quebec" {IF{MERGEFIELD Receipt_Number}= "" "Output for Quebec without Receipt_Number" "Output for Quebec with Receipt_Number"} {IF{MERGEFIELD Receipt_Number}= "" "Output for Not Quebec without Receipt_Number" "Output for Not Quebec with Receipt_Number"}} or: {IF«City»= "Quebec" {IF«Receipt_Number»= "" "Output for Quebec without Receipt_Number" "Output for Quebec with Receipt_Number"} {IF«Receipt_Number»= "" "Output for Not Quebec without Receipt_Number" "Output for Not Quebec with Receipt_Number"}} Do note that, if the Receipt_Number mergefield generates numeric output, you'll need to change the "" expressions to "0" or 0.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you, Paul. Yes, receipt number is numeric. Should I then insert 0 into all places where receipt number is present as well as not present? i.e
{IF«City»= "Quebec" {IF«Receipt_Number»= "0" "Output for Quebec without Receipt_Number" "Output for Quebec with Receipt_Number"} {IF«Receipt_Number»= "0" "Output for Not Quebec without Receipt_Number" "Output for Not Quebec with Receipt_Number"}} thanks again |
#4
|
|||
|
|||
Thank you, Paul. Yes, receipt number is numeric. Should I then insert 0 into all places where receipt number is present as well as not present? i.e
{IF«City»= "Quebec" {IF«Receipt_Number»= "0" "Output for Quebec without Receipt_Number" "Output for Quebec with Receipt_Number"} {IF«Receipt_Number»= "0" "Output for Not Quebec without Receipt_Number" "Output for Not Quebec with Receipt_Number"}} thanks again |
#5
|
||||
|
||||
Please read the previous instructions - there is no provision for 0s where the receipt # is not present. Your revised field code is correct.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
VBA Code to search for field codes with certain text before the Field code and to change style | welcometocandyland | Word VBA | 4 | 02-08-2017 06:53 PM |
IF in field codes? | tinfanide | Word | 1 | 09-15-2016 06:19 AM |
New to Field Codes | Panzer336 | Word | 2 | 04-11-2016 07:57 AM |
Need help with Field Codes | Cosmo | Mail Merge | 25 | 07-30-2015 01:25 PM |
Formula Field using Field Codes | hunter2193 | Word | 3 | 04-05-2013 04:58 AM |