+ Reply to Thread
Results 1 to 3 of 3

Excel data merge to word - date display

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Excel data merge to word - date display

    Good Morning,

    I have data in an excel file which includes dates in the format DD/MM/YY. I have solved the problem with the date changing (in my final word document) to MM/DD/YY by inlcuding \@"DD/MM/YY" in my merge field in the word document, however, I would really like to display the date in my finished word document as Day of month, day, Month, Year (ie. Friday 3rd August, 2012). Is anyone able to advise the DD/MM/YY equivalent to Friday 3rd August, 2012.

    Any help would be most appreciated.

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Excel data merge to word - date display

    You can use a field code in Word like:
    {QUOTE{SET MgDt {MERGEFIELD MyDate}}{MgDt \@ "dddd' 'd"}{IF{=(MOD({={MgDt \@ d}+89},100)>2)*(MOD({={MgDt \@ d}+9},10)<3)}= 1 {=MOD({MgDt \@ d},10)-2 \# rd;st;nd} th}{MgDt \@ "' 'MMMM, yyyy"}
    If you superscript the 'rd', 'st', 'nd' and 'th', they'll come out superscripted in the output as well.

    If you don't care about the ordinal superscription, you could use:
    {MERGEFIELD MyDate \@ "dddd' {MERGEFIELD MyDate \@ d \*Ordinal}' MMMM, yyyy"}

    Note: The field brace pairs (ie '{ }') for the above examples are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message. In both examples, a data field named 'MyDate' is assumed.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    08-02-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Excel data merge to word - date display

    Hi Paul,

    Thank you for such a prompt reply. All sorted now.

    THANK YOU !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1