Re: Date format DD/MM in application wrongly converted to MM/DD in Wor
- From: Peter Jamieson <pjj@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 Jun 2009 09:59:30 +0100
NB, you have landed in a Mac Word group here...
This is just a partial reply - I'll try to be more precise when I have a bit more time to check some results.
Although this problem is known when the data comes from Access/Excel via the OLE DB provider, I haven't heard of it before when the data source is SQL Server. Nor do I know the fix off the top of my head. However, what Word sees is actually just a string. If your MERGEFIELD field, without any date format switch, returns a date like
DD/MM/YYYY or MM/DD/YYYY
then there is problem because Word does not have any information about which is the MM and which is the DD.
What you really need is for OLE DB and/or ODBC to return either
a. exactly the date that you need, and apply no switches (if necessary you can achieve that as long as you are willing to create SQL Server Views that use CAST/CONVERT to convert the date to a string or
b. a date in the format YYYY-MM-DD or YYYY.MM.DD, which I believe Word will always interpret correctly - i.e. you will still need to use a date switch but it should always work.
Peter Jamieson
http://tips.pjmsn.me.uk
M Rizzo wrote:
The date format is showing correctly as DD/MM in a new business application we are testing. The date format is being wrongly converted to MM/DD in Word mail merge when DD<13 e.g. 06/05/2009 (6th May 2009) is being converted to 05/06/2009 (5th June 2009) in Word mail merge despite using a selection of date field switches including.
{ MERGEFIELD date \@ "MMMM d, yyyy"} and { MERGEFIELD date \@ "D MMMM YYYY"} . The issue seems to be that we prefer to work using UK date format (i.e. DD/MM/YYYY). The business application developers who normally write the business application for US customers assure us that they have switched the application to show and export in UK date format. Assuming that they have done this correctly, is there something in our environmental settings which we need to change. Our environment is as follows. SERVER 1: where the business application is installed, SQL 2008, MS Offiice 2003, OS 2003. SERVER 2: application server, Windows 2003 with Office 2000. Apparently the 2 servers are not connected. Please help!
- References:
- Prev by Date: Re: Adding names and words to Dictionary
- Next by Date: Re: How do I generally prevent Word document corruption?
- Previous by thread: Date format DD/MM in application wrongly converted to MM/DD in Wor
- Next by thread: Re: Date format DD/MM in application wrongly converted to MM/DD in Wor
- Index(es):
Relevant Pages
|