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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2003 Advanced Mail Merge

Status
Not open for further replies.

StressedTechie

Technical User
Jul 13, 2001
367
GB
I was wondering if someone could shed some light on the following please.

I have outstanding invoice data that gets sent to Excel every month. I have generateda letter with a table with the following fields.

Balance, Current, 31-60, 61-90, 91-120, older.

Data will then be fed from excel and populate these fields but if a 0 is present I want the field to appear blank or hidden. Am I able to this thanks.
 
Select the field in your merge document, and press Alt-F9. This will turn the field {Sales} to {MERGEFIELD Sales}. Now go in after the field name, and add field switches to format what to do if it is Positive, Negative, or Zero as below:
{MERGEFIELD Sales \# "$#,##0.00;($#,##0.00);" } displays positive, negative, and 0 (zero) values as follows: $1,245.65 if positive
($ 345.56)if negative
<blank> if zero

Sawedoff

 
Thanks mate that works a treat!
Much appreciated!

I have another problem now though.
Okay I have the table in the document with the following headings
Balance, Current, 31-60, 61-90, 91-120, older.

They are populated with figures as described before. Basically its outstanding balances and as they get older they get more serious.

I have used {IF {mergefield current} > 0 "As you will appreciate, this is outside our normal credit terms of one month and we should be grateful if you would send your cheque for this amount by return."

If there are figures in 31-60 days outstanding then the message gets more serious and when it gets to Older then the message is VERY Serious. So basically I have mutiple IF statements below my table. This works fine until a client has figures in more than one field. If they have figures outstanding in Current and 31-60 days then both IF statements trigger. I just want the most serious IF to trigger in this case. Is this possible. Sorry if a little garbled!!

Thanks in advance


 
It may be easier in your Excel sheet to put a column in with a flag. Then check the contents of the flag, and use 3 (or more)different IF-THEN fields. IF FLAG = 30 insert textA, If flag = 60, etc.

The Excel column could have the formula:
=IF(G2>0,90,IF(F2>0,60,IF(E2>0,30," ")))
where G is the 90+, F is the 60-90, and E is the 30-60 fields.

Sawedoff

 
Alternately you could put this statement (modified to fit your data and text) in place of your existing Word-Field statement.

{IF {MERGEFIELD M_90 }>0 "90Text" {IF {MERGEFIELD M_6090 }>0 "60Text" {IF {MERGEFIELD M_3060 }>0 "30Text" ""}}}

Sawedoff

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top