#1
|
|||
|
|||
Help with Date Format and truncating a field
After some help with a merge document I am working on, have done some browsing but cant find exactly what I need. The merge is coming straight from an external application so I can only work on the data in Word.
First thing is I have a date field and I would like it to read "1st April 2013" but I cant see how to insert the "st" or "th" after the day number? Secondly I have some fields that have the text I want but there is some additional text before or after what I need. For example "0123456 - Fred Smith" and all I want is "Fred Smith". Is there a command similar to "LEFT/RIGHT" in Excel I could use? Thanks for any help |
#2
|
||||
|
||||
Hi,
Word fields have no string parsing functions, so you cannot extract "Fred Smith" from "0123456 - Fred Smith". You could use some math functions to extract the "0123456', though. As for the dates, the following field expresses a mailmerge date in ordinal form, coupled with the day of the week – with narrative text: {MERGEFIELD MyDate \@ "dddd 'the {MERGEFIELD MyDate \@ d \*Ordinal} of' MMMM, yyyy"} if you want ehe date ordinals to include superscripting, you can use a field coded as: {QUOTE{SET MM_Date {MERGEFIELD MyDate}}{MM_Date \@ "dddd 'the' d"}{IF{=(MOD({={MM_Date \@ d}+89},100)>2)*(MOD({={MM_Date \@ d}+9},10)<3)}= 1 {=MOD({MM_Date \@ d},10)-2 \# rd;st;nd} th}{MM_Date \@ "' of' MMMM, yyyy"}} where the 'rd', 'st', 'nd' and 'th' are all superscripted. 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.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks for the reply will give that a go, shame about the string parsing!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Date Field to add 10 Days to Current Date | Erbwon | Word | 6 | 11-12-2012 06:17 PM |
changing date format in Bibliography field | elly111sk | Word | 3 | 07-25-2012 06:54 PM |
date format | gsrikanth | Excel | 1 | 12-28-2011 05:06 AM |
Mail merge will not format date field generated by Excel IF statement | borntorun75 | Mail Merge | 3 | 12-16-2011 06:28 AM |
Formula to subtract one month from due date field in reminder field | ghumdinger | Outlook | 1 | 10-01-2011 12:09 AM |