View Single Post
  #2   Report Post  
Graham Mayor
 
Posts: n/a
Default

You need to trap whatever the field *actually* produces, rather than what it
is supposed to produce.
Enter the following {mergefield sdate \@ "yyyyMMdd" }
Trap the resulting figure eg
{ IF { MERGEFIELD sdate \@ "yyyyMMdd" } "20050609" "{ MERGEFIELD sdate
\@"MM/dd/yyyy" }" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Phildeman wrote:
I am getting garbage when a date merge field is empty in word 2002.
I have tried:

{ IF { MERGEFIELD "sdate" } = "" "" "{ MERGEFIELD "sdate"
\@"MM/dd/yyyy" }" } Which indicates, if the merge date field is
empty, then display nothing, else display the value in the merge date
field. Yet, it displays, 06/09/2005. I checked the database and
their is no value in the field.

The database is SQL Server 2000 and I am using Access 2002 to
interface with SQL Server. Then I am using Word 2002 to interface
with Access. When I run the query that Word is using to perform the
merge, the date field displays the data correctly. I am not having
any problems with any other field, only the date field.