View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Merge Switch Question

There may be a simpler way which doesn't easily come to mind, but if your
mergefield produces 165 then you can use some mathematics to get the
information you require. The following should work:

{ =INT({Mergefield Fieldname}/60) \# "0'h'" }{ = 60 * (({Mergefield
Fieldname}/60) - { =INT({Mergefield Fieldname}/60) }) \# "0'mins'"}


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Caroline wrote:
As the result of a recent 'upgrade' to our company database software
I need to reformat a number of the merge documents that information
is pulled into. When a user sets up an appointment it is done via
this software, and part of this includes the duration of the
appointment. Formerly, the software created a CSV file that showed
this as a duration in hours and minuets e.g. "2h 45m" but apparently
this was causing problems for some customers and if now just creates
a CSV file containing the duration in minute format, regardless of
duration. Since some of our appointments last a number of hours, it's
really not suitable to put in 165 minutes in a letter.

I'm using date switches in another part of the letters, but I can't
figure out how to devise a suitable switch to format this number
string into a format where is displays as something like 1h 45mins
instead of just the number of minuets. I'm sure there should be a way
round this, but I just can't find it.

Any suggestions would be very helpful.