Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-10-2014, 04:51 AM
Rothera85 Rothera85 is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Novice
Mailmerge field format?
 
Join Date: May 2014
Posts: 5
Rothera85 is on a distinguished road
Unhappy Mailmerge field format?

Hi, I'm new to mailmerging and very confused.



I have produced a mail merge document which works fine except that I have just added a new date field into the document using and existing field from the database (Excel)

The date will only appear in the document as a 5 digit number which I assume is a day count??

How do I get the proper English date format to appear??

Regards
Reply With Quote
  #2  
Old 05-10-2014, 05:53 AM
macropod's Avatar
macropod macropod is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

IIRC, this would only occur if the column has a mix of data types in the column (e.g. text or numbers, plus the dates). This includes text strings that are formatted to look like dates. If practicable, you should ensure there are only dates in that column. If that can't be done, the serial #s can be converted to dates, but that is liable to convert other numbers also:

{QUOTE
{SET jd{=2415019+{=INT({MERGEFIELD MyDate})}}}
{SET e{=INT((4*(jd+32044)+3)/146097)}}
{SET f{=jd+32044-INT(146097*e/4)}}
{SET g{=INT((4*f+3)/1461)}}
{SET h{=f-INT(1461*g/4)}}
{SET i{=INT((5*h+2)/153)}}
{SET dd{=h-INT((153*i+2)/5)+1}}
{SET mm{=i+3-12*INT(i/10)}}
{SET yy{=100*e+g-4800+INT(i/10)}}
"{dd}-{mm}-{yy}" \@ "dddd, d MMMM yyyy"}

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues. Likewise, you can't type or copy & paste the chevrons (i.e. '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar. The spaces represented in the field construction are all required, but the line breaks aren't - they're just to make the field code easier to read.

For a macro to convert the above field text strings to working field codes, see: http://www.gmayor.com/export_field.htm#TextToField
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-10-2014, 02:27 PM
Rothera85 Rothera85 is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Novice
Mailmerge field format?
 
Join Date: May 2014
Posts: 5
Rothera85 is on a distinguished road
Default

Hi Paul,

I'm afraid all that was way beyond my small brain.

The cell in the excel file is formatted as a date.

The date is entered as follows: 17/5/14 which displays as 17 May 2014

This still only displays as the 5 digit number in the Word document.

Cheers,

Andy
Reply With Quote
  #4  
Old 05-10-2014, 02:58 PM
macropod's Avatar
macropod macropod is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Is there anything other than dates in this column? For example, if you change the number format to, say, General, do all the dates change to 5-digit numbers? Is there anything else in the same column that isn't a date? For example, and ordinary number or some text?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-11-2014, 02:24 AM
Rothera85 Rothera85 is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Novice
Mailmerge field format?
 
Join Date: May 2014
Posts: 5
Rothera85 is on a distinguished road
Default

Hi Paul,
As far as I can see, the only thing in the column are dates and some blank cells.

Cheers,

Andy
Reply With Quote
  #6  
Old 05-11-2014, 08:34 AM
macropod's Avatar
macropod macropod is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Are there blanks in the first 8 rows?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 05-11-2014, 09:04 AM
Rothera85 Rothera85 is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Novice
Mailmerge field format?
 
Join Date: May 2014
Posts: 5
Rothera85 is on a distinguished road
Default

Hi Paul,

Yes, I may have just realised the problem??
Row 1 is a title (not a date!)
Rows 2 - 9 are blank, from 10 on there is a date in each cell.

It's a good job you know what to look for?

Cheers,

Andy
Reply With Quote
  #8  
Old 05-11-2014, 03:13 PM
macropod's Avatar
macropod macropod is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

That, then is the cause of the problem. To determine how to represent the output data, the OLE DB provider first 8 records to determine the data type. In this case, they don't contain dates. If you can reorder the data so you have just dates there, they'll merge correctly. I assume your title (Row 1) is the header row - don't move that!
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 05-11-2014, 03:28 PM
Rothera85 Rothera85 is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Novice
Mailmerge field format?
 
Join Date: May 2014
Posts: 5
Rothera85 is on a distinguished road
Default

Hi Paul,
I just put dummy dates in the first 9 rows and guess what, you are a genius!!

One last question before I let you escape, how do I get the English date format in the word doc. It is displayed correctly in the database but changes to the US format in Word.

7th April 2014 becomes 4/7/2014

Cheers,

Andy
Reply With Quote
  #10  
Old 05-11-2014, 03:41 PM
macropod's Avatar
macropod macropod is offline Mailmerge field format? Windows 7 32bit Mailmerge field format? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The OLE DB server used for mailmerges basically imports just the data, with little attention to its formatting. However, Word has extensive support for managing the formats. See: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailmerge field format? Mailmerge printing with field names Jvallee Mail Merge 9 04-16-2014 06:30 PM
Mailmerge field format? Yes/No field does not work in mailmerge Abacus1234 Mail Merge 10 10-14-2013 06:37 AM
Mailmerge field format? Mailmerge Data Format tombradley Mail Merge 1 09-29-2013 07:35 PM
Mailmerge field format? Field Format issue zjordan Word 7 04-18-2013 06:55 AM
Merge Word documents using a mailmerge field Concertina Mail Merge 3 02-18-2013 04:12 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft