MyBash | Mobile | Offices |
Directories
Help Desk
Knowledge Base
Knowledge Base - Using Merge field switches to format data in WORD
by Alice Moore
03/30/2006 (Software)


When locating merge field on WORD documents, the HS GPA and decile fields (in Admissions merges)  print several decimals.  To resolve this problem I use the following field switches:
 
\# #.###  on the GPA field  and   \# ##.### on the decile field
==========================================================
 
This behavior occurs because the data is displayed in its native, stored format in Access or Excel. To format merged data, you must format the merge fields in the main document. If you format the data in the data source, the formatting is not retained when you merge the data into the main document.
 
WORKAROUND
To work around this problem, use one of the following methods.
 

In Microsoft Word

Use a switch to format the results of the MERGEFIELD. To do this, use one of the following methods.

Note To view the field codes in Microsoft Word, press ALT+F9.

Method 1: Use the Numeric Picture Switch

Include a numeric picture switch (\#) similar to one of the following examples:

In a currency field, use a Numeric Picture switch similar to:
{MERGEFIELD number \# $####,0.0}
Note The {MERGEFIELD number \# $####,0.0} string works for Microsoft SQL Server 6 as well.

In a telephone field, use a Numeric Picture switch similar to:
{MERGEFIELD phone \# ###'-'###'-'####}
Note The hyphen inside the mergefield is in single quotation marks. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
121938 (http://support.microsoft.com/kb/121938/) Hyphens don't display correctly with numeric picture switch

Method 2: Use the Date-Time Picture Switch

Include a date-time picture switch (\@) in the Date field, so that the Date field looks like this:
{MERGEFIELD date \@ "MMMM d, yyyy"}
Note The picture switch is case-sensitive. Additionally, you must use quotation marks around the picture string.