Removing leading characters from word field

P

Peter Wilde

I'm creating a mail merge using data extracted from a
DBISAM database. One field in the database is a TimeStamp
which returns the date and time as follows '30/12/2003
9:30:00 AM' In my mail merge letter I need to include the
time only and would like to strip the date from the
beginning of the field. Microsoft SQL Query does not
allow me to use the substring command. Is there a solution
 
M

macropod

Hi Peter,

You can control this in Word by adding a date & time picture switch to your
mergefield. To do this, select the field and press Shift-F9. Your field
should look something like:
{MERGEFIELD TimeStamp}
Edit the field, by adding: \@ "hh:mm:ss" after the source data name, so that
the field looks like:
{MERGEFIELD TimeStamp \@ "hh:mm:ss"}

Alternatively, if TimeStamp can exceed 24 hours, change the picture switch
to \@ "HH:mm:ss"

Cheers
 
P

Peter Wilde

Dear Macropod,

You're a genius! I spent 2 hours trying to solve this
problem and you've given me the answer in 30 sec. Thanks.

Peter Wilde
 

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