Solved

Mail merge IF Statements

Posted on 2016-11-10
8
60 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 50

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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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
 
LVL 50

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 50

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

726 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