If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
DATE MergeField not formatting!
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 datetime 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 date remains in the source format, neither modifying the date's format, nor removing the time -- i.e.: 1/1/1900 12:00:00 AM I've tried enclosing the date format-picture in double-quotes, but to no avail... Any ideas? fendwick ------------------------------------------------ ~~ Message posted from http://www.WordForums.com/ |
#2
|
|||
|
|||
DATE MergeField not formatting!
Hi fendwick,
Try: { MERGEFIELD Final_Payment_Date \@ "MM/dd/yyyy" } Cheers "fendwick" wrote in message ... 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 datetime 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 date remains in the source format, neither modifying the date's format, nor removing the time -- i.e.: 1/1/1900 12:00:00 AM I've tried enclosing the date format-picture in double-quotes, but to no avail... Any ideas? fendwick ------------------------------------------------ ~~ Message posted from http://www.WordForums.com/ --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.627 / Virus Database: 402 - Release Date: 16/03/2004 |
#3
|
|||
|
|||
DATE MergeField not formatting!
Thanks for the suggestion, Del: 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! f del NO.SPAM wrote: *Hi fendwick, Try: { MERGEFIELD Final_Payment_Date \@ "MM/dd/yyyy" } Cheers * ------------------------------------------------ ~~ Message posted from http://www.WordForums.com/ |
#4
|
|||
|
|||
DATE MergeField not formatting!
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 :-) |
Thread Tools | |
Display Modes | |
|
|