Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2013, 02:20 AM
mr starface mr starface is offline Help with Date Format and truncating a field Windows 7 64bit Help with Date Format and truncating a field Office 2007
Novice
Help with Date Format and truncating a field
 
Join Date: Apr 2013
Posts: 2
mr starface is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 04-29-2013, 05:40 AM
macropod's Avatar
macropod macropod is offline Help with Date Format and truncating a field Windows 7 64bit Help with Date Format and truncating a field 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

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]
Reply With Quote
  #3  
Old 04-29-2013, 07:08 AM
mr starface mr starface is offline Help with Date Format and truncating a field Windows 7 64bit Help with Date Format and truncating a field Office 2007
Novice
Help with Date Format and truncating a field
 
Join Date: Apr 2013
Posts: 2
mr starface is on a distinguished road
Default

Thanks for the reply will give that a go, shame about the string parsing!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Date Format and truncating a field Date Field to add 10 Days to Current Date Erbwon Word 6 11-12-2012 06:17 PM
Help with Date Format and truncating a field 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
Help with Date Format and truncating a field 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:56 AM.


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