Format dates in merge using database fields

J

jeff

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
 
P

Peter Jamieson

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.
 
J

Jeffro

Thanks for you suggestions!
Jeff

Peter Jamieson said:
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.

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

jeff said:
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
 

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