mail merging date fields from excel

P

pama

Hello everyone,
I have the same problem as the post on 12/8/05 "Data fields in mail merge",
so I will use their elequent words...
"I have a Word mail merge document, used to import Excel data - only dates.
When I have merged the data, all empty Excel date cells are populated in Word
by 12:00AM."
I then tried the fix for it.....
Use

{ IF { MERGEFIELD contract_received } <> "" { MERGEFIELD contract_received
\@"DD/MM/YYYY" } "" }

But this did not work.
Any suggestions?
 
D

Doug Robbins - Word MVP

What was the result?

Did you use Ctrl+F9 to insert each pair of field delimiters {}?

The formatting switch should be \@ "dd/MM/yyyy"

You may be able to fix the problem by selecting Options from the Tools menu
in Word and then go to the General tab and check the box against "Confirm
conversions at open" Then, when you attach the data source to the mail
merge main document, use the DDE option.

Alternatively, use the following field construction:

{ IF { MERGEFIELD contract_received } "12:00AM" { MERGEFIELD
contract_received
\@ "dd/MM/yyyy" } "" }

I am not sure that 12:00AM is exactly what is now being displayed when the
field is empty, so you should replace that what is actually being displayed.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
G

Graham Mayor

The problem is that the fields are not empty - they are reproducing
12:00AM - so you need to modify the condition to search for that

{ IF { MERGEFIELD contract_received } <> "12:00*" "{ MERGEFIELD
contract_received \@ "dd/MM/yyyy" }" }
should do the trick - or put *exactly* what the 'empty' fields produce in
place of 12:00* above.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

pama

Thanks for your help Doug and Graham.
There are several potential "go arounds" like the IF statement:
{ IF { MERGEFIELD contract_received } <> "12:00" { MERGEFIELD
contract_received \@ "dd/MM/yyyy" }""}

which did finally work.

The problem with the original if statement:
{ IF { MERGEFIELD contract_received } <> "" { MERGEFIELD contract_received
\@"DD/MM/YYYY" } "" }

is that Word does not see that field as blank, so it will always format
"something" as a date, such as the current date. But putting <>12:00 (even
without all the formatting such as 12:00:00 AM) worked. Still, that is going
around the problem.

What fixed the problem entirely was merging with the DDE option. This makes
Word behave as you would expect in this case. Thank you again.
Pascale.
 
G

Graham Mayor

Only problem is that while DDE often works, it is not reliable, which is one
reason why Microsoft moved away from it. The conditional field always works.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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