View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Merge Switch Question

As long as the field in the CSV is just a number, you could use something
like

{ = mod({ MERGEFIELD duration },60) \#0 }

to give you the minutes and

{ = int({ MERGEFIELD duration }/60) }

to give you the hours.

If the field also specifies the units, e.g.

{ = mod({ MERGEFIELD duration \#0 },60) \#0 }

to give you the minutes and

{ = int({ MERGEFIELD duration \#0 }/60) }

i.e. using a numeric format switch should effectively strip off the "mins"

Peter Jamieson
131mins

then you can probably get away with


"Caroline" wrote in message
...
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.