Solved

Mail merge IF Statements

Posted on 2016-11-10
8
39 Views
Last Modified: 2016-11-11
hi i am trying to do an if statement in mail merge, heres what i am trying to do in non code terms

i have a field called unitprice if this field contains 0 i want to blank it out but if the field desc is not blank i dont want to blank it our i want to keep the 0

how would i do this?

p.s. hope this makes sense
0
Comment
Question by:Jade Laird
  • 4
  • 3
8 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 41882801
You seem to have some typos in your question. I guess that the last few words of your second paragraph: "our i want to keep the 0"  should read "out, I want to keep the field value."

If so, the fields should look like this:
{ If { MAILMERGE unitprice } = 0 "" { MAILMERGE unitprice } }
0
 

Author Comment

by:Jade Laird
ID: 41883410
Yeah sorry for the typos. im not sure that will work, wont i need to consider the field DESC

simpler way to put it i want to always blank out the field unitprice when equals 0 unless field desc is not blank.

wont i need nested if statements.

sorry new to this.
0
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 41883415
HI,

pls try

 { IF { = { IF {Mergefield desc  } = "" 1 0 } + { IF {Mergefield unitprice } = 0 1 0 } } =  2 ""  { MAILMERGE unitprice }  } 

Open in new window

Regards
0
 

Author Comment

by:Jade Laird
ID: 41883439
It doesnt seem to work.

example:

DESC     UNITPRICE
                  0
TSHIRT     0

So from the data above where desc is blank unit price needs to be blank, where desc is not blank unit price needs to keep the value
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 41883448
maybe try
 { IF { = { IF {Mergefield desc  } = "" 1 0 } + { IF {Mergefield unitprice } = "0" 1 0 } } =  2 ""  { MAILMERGE unitprice }  } 

Open in new window

0
 

Author Comment

by:Jade Laird
ID: 41883477
Think i may have solved this by doing


{IF{MERGEFIELD DESC} = "" "" {IF{MERGEFIELD DESC} <> "" {MERGEFIELD UNITPRICE}}}
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41883480
pls try
{IF{MERGEFIELD DESC} = "" "" {MERGEFIELD UNITPRICE}} 

Open in new window

0
 

Author Closing Comment

by:Jade Laird
ID: 41883482
Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now