Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: x picture item rounding

Geek News

x picture item rounding
Laurel 6/7/2007 12:37:01 PM
Hello All,
I'm using the x picture item to the display the last 4 digits of my field
which is a 16 digit number. The documentation says "Drops digits to the left
of the "x" placeholder. If the placeholder is to the right of the decimal
point, Word rounds the result to that place."

Word is rounding my number even though there is no decimal. Is this because
the number is so large? If I use a smaller number it doesn't round. I tried
to solve the problem by using the INT(x) function but that didn't work. Is
this a bug?

I appreciate any insight or help can you give.

Thanks,
Laurel
Re: x picture item rounding
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 6/7/2007 1:12:27 PM
HI Laurel -

Yes. the problem is with the length of the number (as I suggested in the
previous thread - you can take this kind of approach up to around 14
digits). I don't think any of the other formula field suggestions made there
will help either).

In addition to the other workarounds I suggested...

---------------------------------
If the account number is more complex there are two things you can do other
than transform your data source into another format:
a. use a DATABASE field - nasty, but see http://tips.pjmsn.me.uk/t0004.htm
b. use Word VBA to issue a SQL query to get the data from the .csv file,
and put the necessary right() function in that query. That isn't
straightforward either, but it can usually be done as long as the .csv can
be read by the Jet ODBC driver/OLE DB provider and doesn't have more than
255 fields.
---------------------------------

....you may also be able to use the 16-digit kludge described in the "Number
fields" section on Graham Mayor's page at

http://www.gmayor.com/formatting_word_fields.htm

(I'm not sure if it is workable in the situaiton you describe)

Peter Jamieson

"Laurel" <Laurel[ at ]discussions.microsoft.com> wrote in message
news:17CE17F0-FC69-48C1-9D6A-0F63A862D017[ at ]microsoft.com...
[Quoted Text]
> Hello All,
> I'm using the x picture item to the display the last 4 digits of my field
> which is a 16 digit number. The documentation says "Drops digits to the
> left
> of the "x" placeholder. If the placeholder is to the right of the decimal
> point, Word rounds the result to that place."
>
> Word is rounding my number even though there is no decimal. Is this
> because
> the number is so large? If I use a smaller number it doesn't round. I
> tried
> to solve the problem by using the INT(x) function but that didn't work. Is
> this a bug?
>
> I appreciate any insight or help can you give.
>
> Thanks,
> Laurel

Re: x picture item rounding
Laurel 6/8/2007 12:14:02 PM
Thanks so much. You guys are awesome. If only Microsoft would bend to my will!

"Peter Jamieson" wrote:

[Quoted Text]
> HI Laurel -
>
> Yes. the problem is with the length of the number (as I suggested in the
> previous thread - you can take this kind of approach up to around 14
> digits). I don't think any of the other formula field suggestions made there
> will help either).
>
> In addition to the other workarounds I suggested...
>
> ---------------------------------
> If the account number is more complex there are two things you can do other
> than transform your data source into another format:
> a. use a DATABASE field - nasty, but see http://tips.pjmsn.me.uk/t0004.htm
> b. use Word VBA to issue a SQL query to get the data from the .csv file,
> and put the necessary right() function in that query. That isn't
> straightforward either, but it can usually be done as long as the .csv can
> be read by the Jet ODBC driver/OLE DB provider and doesn't have more than
> 255 fields.
> ---------------------------------
>
> ....you may also be able to use the 16-digit kludge described in the "Number
> fields" section on Graham Mayor's page at
>
> http://www.gmayor.com/formatting_word_fields.htm
>
> (I'm not sure if it is workable in the situaiton you describe)
>
> Peter Jamieson
>
> "Laurel" <Laurel[ at ]discussions.microsoft.com> wrote in message
> news:17CE17F0-FC69-48C1-9D6A-0F63A862D017[ at ]microsoft.com...
> > Hello All,
> > I'm using the x picture item to the display the last 4 digits of my field
> > which is a 16 digit number. The documentation says "Drops digits to the
> > left
> > of the "x" placeholder. If the placeholder is to the right of the decimal
> > point, Word rounds the result to that place."
> >
> > Word is rounding my number even though there is no decimal. Is this
> > because
> > the number is so large? If I use a smaller number it doesn't round. I
> > tried
> > to solve the problem by using the INT(x) function but that didn't work. Is
> > this a bug?
> >
> > I appreciate any insight or help can you give.
> >
> > Thanks,
> > Laurel
>
>
Re: x picture item rounding
Laurel 6/8/2007 2:24:01 PM
I was able to get this to work in a mini test document but when I tried to
recreate it in my real document, I got the blasted Syntax error with my
MERGEFIELD. Any clue what I might be doing wrong?

{=INT({=MOD({MERGEFIELD Cardholder_Number},10000)})\# x###}

Thanks,
Laurel

"Laurel" wrote:

[Quoted Text]
> Thanks so much. You guys are awesome. If only Microsoft would bend to my will!
>
> "Peter Jamieson" wrote:
>
> > HI Laurel -
> >
> > Yes. the problem is with the length of the number (as I suggested in the
> > previous thread - you can take this kind of approach up to around 14
> > digits). I don't think any of the other formula field suggestions made there
> > will help either).
> >
> > In addition to the other workarounds I suggested...
> >
> > ---------------------------------
> > If the account number is more complex there are two things you can do other
> > than transform your data source into another format:
> > a. use a DATABASE field - nasty, but see http://tips.pjmsn.me.uk/t0004.htm
> > b. use Word VBA to issue a SQL query to get the data from the .csv file,
> > and put the necessary right() function in that query. That isn't
> > straightforward either, but it can usually be done as long as the .csv can
> > be read by the Jet ODBC driver/OLE DB provider and doesn't have more than
> > 255 fields.
> > ---------------------------------
> >
> > ....you may also be able to use the 16-digit kludge described in the "Number
> > fields" section on Graham Mayor's page at
> >
> > http://www.gmayor.com/formatting_word_fields.htm
> >
> > (I'm not sure if it is workable in the situaiton you describe)
> >
> > Peter Jamieson
> >
> > "Laurel" <Laurel[ at ]discussions.microsoft.com> wrote in message
> > news:17CE17F0-FC69-48C1-9D6A-0F63A862D017[ at ]microsoft.com...
> > > Hello All,
> > > I'm using the x picture item to the display the last 4 digits of my field
> > > which is a 16 digit number. The documentation says "Drops digits to the
> > > left
> > > of the "x" placeholder. If the placeholder is to the right of the decimal
> > > point, Word rounds the result to that place."
> > >
> > > Word is rounding my number even though there is no decimal. Is this
> > > because
> > > the number is so large? If I use a smaller number it doesn't round. I
> > > tried
> > > to solve the problem by using the INT(x) function but that didn't work. Is
> > > this a bug?
> > >
> > > I appreciate any insight or help can you give.
> > >
> > > Thanks,
> > > Laurel
> >
> >
Re: x picture item rounding
"Graham Mayor" <gmayor[ at ]REMOVETHISmvps.org> 6/9/2007 5:36:56 AM
It works for me - are you sure you didn't miss a bracket, or used {} from
the keyboard instead of CTRL+F9, or do as I often do and get a typo in the
word Mergefield?
What do you get from {MERGEFIELD Cardholder_Number} alone?
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

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

Laurel wrote:
[Quoted Text]
> I was able to get this to work in a mini test document but when I
> tried to recreate it in my real document, I got the blasted Syntax
> error with my MERGEFIELD. Any clue what I might be doing wrong?
>
> {=INT({=MOD({MERGEFIELD Cardholder_Number},10000)})\# x###}
>
> Thanks,
> Laurel
>
> "Laurel" wrote:
>
>> Thanks so much. You guys are awesome. If only Microsoft would bend
>> to my will!
>>
>> "Peter Jamieson" wrote:
>>
>>> HI Laurel -
>>>
>>> Yes. the problem is with the length of the number (as I suggested
>>> in the previous thread - you can take this kind of approach up to
>>> around 14 digits). I don't think any of the other formula field
>>> suggestions made there will help either).
>>>
>>> In addition to the other workarounds I suggested...
>>>
>>> ---------------------------------
>>> If the account number is more complex there are two things you can
>>> do other than transform your data source into another format:
>>> a. use a DATABASE field - nasty, but see
>>> http://tips.pjmsn.me.uk/t0004.htm b. use Word VBA to issue a SQL
>>> query to get the data from the .csv file, and put the necessary
>>> right() function in that query. That isn't straightforward either,
>>> but it can usually be done as long as the .csv can be read by the
>>> Jet ODBC driver/OLE DB provider and doesn't have more than 255
>>> fields. ---------------------------------
>>>
>>> ....you may also be able to use the 16-digit kludge described in
>>> the "Number fields" section on Graham Mayor's page at
>>>
>>> http://www.gmayor.com/formatting_word_fields.htm
>>>
>>> (I'm not sure if it is workable in the situaiton you describe)
>>>
>>> Peter Jamieson
>>>
>>> "Laurel" <Laurel[ at ]discussions.microsoft.com> wrote in message
>>> news:17CE17F0-FC69-48C1-9D6A-0F63A862D017[ at ]microsoft.com...
>>>> Hello All,
>>>> I'm using the x picture item to the display the last 4 digits of
>>>> my field which is a 16 digit number. The documentation says "Drops
>>>> digits to the left
>>>> of the "x" placeholder. If the placeholder is to the right of the
>>>> decimal point, Word rounds the result to that place."
>>>>
>>>> Word is rounding my number even though there is no decimal. Is this
>>>> because
>>>> the number is so large? If I use a smaller number it doesn't
>>>> round. I tried
>>>> to solve the problem by using the INT(x) function but that didn't
>>>> work. Is this a bug?
>>>>
>>>> I appreciate any insight or help can you give.
>>>>
>>>> Thanks,
>>>> Laurel


Re: x picture item rounding
Laurel 6/19/2007 6:45:01 PM
That was the correct code. I wasn't connected to my data source (doh!). Thank
you so much for your help!!

"Graham Mayor" wrote:

[Quoted Text]
> It works for me - are you sure you didn't miss a bracket, or used {} from
> the keyboard instead of CTRL+F9, or do as I often do and get a typo in the
> word Mergefield?
> What do you get from {MERGEFIELD Cardholder_Number} alone?
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> Laurel wrote:
> > I was able to get this to work in a mini test document but when I
> > tried to recreate it in my real document, I got the blasted Syntax
> > error with my MERGEFIELD. Any clue what I might be doing wrong?
> >
> > {=INT({=MOD({MERGEFIELD Cardholder_Number},10000)})\# x###}
> >
> > Thanks,
> > Laurel
> >
> > "Laurel" wrote:
> >
> >> Thanks so much. You guys are awesome. If only Microsoft would bend
> >> to my will!
> >>
> >> "Peter Jamieson" wrote:
> >>
> >>> HI Laurel -
> >>>
> >>> Yes. the problem is with the length of the number (as I suggested
> >>> in the previous thread - you can take this kind of approach up to
> >>> around 14 digits). I don't think any of the other formula field
> >>> suggestions made there will help either).
> >>>
> >>> In addition to the other workarounds I suggested...
> >>>
> >>> ---------------------------------
> >>> If the account number is more complex there are two things you can
> >>> do other than transform your data source into another format:
> >>> a. use a DATABASE field - nasty, but see
> >>> http://tips.pjmsn.me.uk/t0004.htm b. use Word VBA to issue a SQL
> >>> query to get the data from the .csv file, and put the necessary
> >>> right() function in that query. That isn't straightforward either,
> >>> but it can usually be done as long as the .csv can be read by the
> >>> Jet ODBC driver/OLE DB provider and doesn't have more than 255
> >>> fields. ---------------------------------
> >>>
> >>> ....you may also be able to use the 16-digit kludge described in
> >>> the "Number fields" section on Graham Mayor's page at
> >>>
> >>> http://www.gmayor.com/formatting_word_fields.htm
> >>>
> >>> (I'm not sure if it is workable in the situaiton you describe)
> >>>
> >>> Peter Jamieson
> >>>
> >>> "Laurel" <Laurel[ at ]discussions.microsoft.com> wrote in message
> >>> news:17CE17F0-FC69-48C1-9D6A-0F63A862D017[ at ]microsoft.com...
> >>>> Hello All,
> >>>> I'm using the x picture item to the display the last 4 digits of
> >>>> my field which is a 16 digit number. The documentation says "Drops
> >>>> digits to the left
> >>>> of the "x" placeholder. If the placeholder is to the right of the
> >>>> decimal point, Word rounds the result to that place."
> >>>>
> >>>> Word is rounding my number even though there is no decimal. Is this
> >>>> because
> >>>> the number is so large? If I use a smaller number it doesn't
> >>>> round. I tried
> >>>> to solve the problem by using the INT(x) function but that didn't
> >>>> work. Is this a bug?
> >>>>
> >>>> I appreciate any insight or help can you give.
> >>>>
> >>>> Thanks,
> >>>> Laurel
>
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net