Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Caroline
 
Posts: n/a
Default Merge Switch Question

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, its really
not suitable to put in 165 minutes in a letter.

Im using date switches in another part of the letters, but I cant 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. Im sure there should be a way round this, but I just
cant find it.

Any suggestions would be very helpful.
  #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.



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

Thank you both so very much.

I think I was just about to go crazy. Thank you again... you really have
saved me so much stress... and as a bonus I now understand switches a heck of
a lot better.

Have a great week.
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Merge Switch Question

This problem was sufficiently interesting to add the solutions to my web
site - see http://www.gmayor.com/formatting_word_fields.htm

--

Graham Mayor - Word MVP

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


Caroline wrote:
Thank you both so very much.

I think I was just about to go crazy. Thank you again... you really
have saved me so much stress... and as a bonus I now understand
switches a heck of a lot better.

Have a great week.



  #5   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.





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Lee Grimm
 
Posts: n/a
Default Merge Switch Question


In a merge field, how do I convert a currency format to a text format
or, in the alternative a number format to a text format


--
Lee Grimm
Posted from - http://www.officehelp.in

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

Graham Mayor's excellent page at
http://www.gmayor.com/formatting_word_fields.htm will probably tell you most
of what you need to know. If not, ask your question.

Peter Jamieson

"Lee Grimm" wrote in message
...

In a merge field, how do I convert a currency format to a text format
or, in the alternative a number format to a text format


--
Lee Grimm
Posted from - http://www.officehelp.in



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge Question NKYBred Microsoft Word Help 0 October 5th 05 03:11 PM
Mail merge question ? simplym Mailmerge 1 August 3rd 05 10:13 PM
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
Can I use merge to create 3x5 question and answer flash cards? colleen New Users 1 February 4th 05 11:39 AM
merge with excel question Cowtoon Mailmerge 1 December 7th 04 11:51 AM


All times are GMT +1. The time now is 02:25 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"