Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2004

Tip: Looking for answers? Try searching our database.

Format dates in merge using database fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jeff - 26 Apr 2004 19:42 GMT
Have a M.S. Access query set up to query an INFORMIX
database to query and return 3 fields

class name char(14)
sdate date
edate date

I have set up a WORD merge to used the records returned
from the Access query as my data source.  When I run the
merge, the dates print out in the format:

yyyy-mm-dd 00:00:00

I would like to have the dates print out with the format:
mm/dd/yyyy.  Is it possible to change the print format of
the dates and if so, would this be done in Access or in
WORD?

Thanks
Peter Jamieson - 27 Apr 2004 12:39 GMT
If Word recognises the field as being a date, you can try altering the
"field code" in the MERGEFIELD that inserts it:

{ MERGEFIELD fieldname \@"MM/DD/YYYY" }

instea of

{ MERGEFIELD fieldname  }

If Word does not recognise the field as a date, you can reformat the date
using some code in an Access query - e.g. in this case you might use
something like

SELECT *, mid(sdate,6,2) & "/" & mid(sdate,9,2) & "/" & left(sdate,4) AS
[sdate2] FROM mytable

then use that query as the data source for your merge.

Signature

Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/

> Have a M.S. Access query set up to query an INFORMIX
> database to query and return 3 fields
[quoted text clipped - 15 lines]
>
> Thanks
Jeffro - 28 Apr 2004 16:44 GMT
Thanks for you suggestions!
Jeff

> If Word recognises the field as being a date, you can try altering the
> "field code" in the MERGEFIELD that inserts it:
[quoted text clipped - 33 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.