DATE MergeField not formatting!

F

fendwick

I am attempting to format a date field in a Word 2002 (10.2627.3311
Merge Main document, connecting to an SQL Server 8.0 database datetim
field, using a File DSN (ODBC) connection.
The field-code I'm using is:
{ MERGEFIELD "Final_Payment_Date" \@ MM/dd/yyyy }

But although the document merges successfully, the returned dat
remains in the source format, neither modifying the date's format, no
removing the time -- i.e.:
1/1/1900 12:00:00 AM

I've tried enclosing the date format-picture in double-quotes, but t
no avail...

Any ideas?

fendwic
 
F

fendwick

Thanks for the suggestion, Del:

I tried modifying the field by removing the double-quotes from th
db-field-name and replacing them around the date-pattern, but to n
effect, alas!

I have implemented a workaround in the SQL database, saving the dat
to an 11-char varchar field, effectively truncating off the time, bu
it is an ugly fix, especially as I don't understand why I should hav
to resort to it...!

If anyone has any ideas for fixing this misbehavior, or eve
explanations why it occurs, I should be happy to hear them!

f
 
C

Cindy M -WordMVP-

Hi Fendwick,

ODBC can do odd things, sometimes. Since you have Word 2002, have you
tried an OLE DB connection? OLE DB gives problems for Excel and Access,
but I thought it generally worked OK with SQL...?
I tried modifying the field by removing the double-quotes from the
db-field-name and replacing them around the date-pattern, but to no
effect, alas!

I have implemented a workaround in the SQL database, saving the date
to an 11-char varchar field, effectively truncating off the time, but
it is an ugly fix, especially as I don't understand why I should have
to resort to it...!

If anyone has any ideas for fixing this misbehavior, or even
explanations why it occurs, I should be happy to hear them!

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

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