Mail Merge date from txt data source

C

CWilminko

I have a text file as my data source with a date formatted as, 20081231,
which I'm using for a mail merge. I would prefer these dates to be displayed
in a more friendly format. I have the following, which works if the source
file uses the slashes, e.g. 2008/12/31:
{ MERGEFIELD EXPIRATION_DATE \@ "dddd, MMMM d, yyyy" }

How can I get the same results using the plain 20081231 type of date?
Thank you for your help.
Cynthia
 
M

macropod

Hi CWilminko,

You could use a field construction like:
{QUOTE{MERGEFIELD MyDate \# "0000'-'00'-'00" } \@ "DDDD, D MMMM YYYY"}
where 'MyDate' is the name of the date field in your datasource. With this switch, 20081231 will come out as 'Thursday, 31 December
2008'. Other possible date formatting switches include:
.. \@ "DDD, D MMM yyyy";
.. \@ "D MMM YYYY";
.. \@ "DD/MMM/YYYY";
.. \@ "D-MM-YY";
You must use uppercase 'M's for months, but you can use lowercase 'D's and 'Y's for days and years, respectively.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.
 
C

CWilminko

Thank you very much! That works like a charm.

macropod said:
Hi CWilminko,

You could use a field construction like:
{QUOTE{MERGEFIELD MyDate \# "0000'-'00'-'00" } \@ "DDDD, D MMMM YYYY"}
where 'MyDate' is the name of the date field in your datasource. With this switch, 20081231 will come out as 'Thursday, 31 December
2008'. Other possible date formatting switches include:
.. \@ "DDD, D MMM yyyy";
.. \@ "D MMM YYYY";
.. \@ "DD/MMM/YYYY";
.. \@ "D-MM-YY";
You must use uppercase 'M's for months, but you can use lowercase 'D's and 'Y's for days and years, respectively.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[MVP - Microsoft Word]


CWilminko said:
I have a text file as my data source with a date formatted as, 20081231,
which I'm using for a mail merge. I would prefer these dates to be displayed
in a more friendly format. I have the following, which works if the source
file uses the slashes, e.g. 2008/12/31:
{ MERGEFIELD EXPIRATION_DATE \@ "dddd, MMMM d, yyyy" }

How can I get the same results using the plain 20081231 type of date?
Thank you for your help.
Cynthia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top