Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mailmerge issue 1

Status
Not open for further replies.

cramd

Programmer
Mar 28, 2001
214
US
I have created a mailmerge document and my problem is when I calculate two mergefields together with one of the mergefields having a zero balance I get an error. I want to eliminate the two fields from calculating if one of the fields is zero.
This statement works providing there is a numeric balance other than 0:
{={mergefield "balance1"} + {mergefield "balance2"}}
if either field is 0, then I get an error "missing string operator".
I am trying
"if balance1 = 0, display balance2,
else
if balance2 = 0, display balance1,
else
{={mergefield "balance1"} + {mergefield "balance2"}}
but my syntax with this doesn't seem to be working.
Any help would be greatly appreciated.
cramd

 
Hi cramd
I notice you have quoted the fields balance1 and balance2, which suggests they are bookmarks. I have not used bookmarks on the following, which works for me:
[tt]{ = { IF { MERGEFIELD Balance1 } = “” “0” { MERGEFIELD Balance1 } } + { IF { MERGEFIELD Balance2 } = “” “0” { MERGEFIELD Balance2 } } \* MERGEFORMAT }[/tt]

I did not get an error with zeros, but I did with blank fields, so I used
IF { MERGEFIELD Balance1 } = “”
to substitute zeros for blanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top