Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
projectmergeleader projectmergeleader is offline
external usenet poster
 
Posts: 11
Default IF statement problem

I am writing a mail merge project to create a number of invoices from a
database created in access. I need to check a number that I obtained using a
count statement to see if it is between certain boundaries. When I try to do
this it does not work and the else staement is always executed. It may be
because the number is stored as text but even direct comparison doesn't work.

Also I need to round a number down to the nearest 0.01(its a price). Does
anyone know how to achieve this?

Thanks in advance,

S
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default IF statement problem

What does the code in your IF field look like at the moment?

Also I need to round a number down to the nearest 0.01(its a price). Does


Have you tried the usualy formatting switches, or is the problem rounding
rather than truncation?

--
Peter Jamieson
http://tips.pjmsn.me.uk

"projectmergeleader" wrote in
message ...
I am writing a mail merge project to create a number of invoices from a
database created in access. I need to check a number that I obtained using
a
count statement to see if it is between certain boundaries. When I try to
do
this it does not work and the else staement is always executed. It may be
because the number is stored as text but even direct comparison doesn't
work.

Also I need to round a number down to the nearest 0.01(its a price). Does
anyone know how to achieve this?

Thanks in advance,

S


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
projectmergeleader projectmergeleader is offline
external usenet poster
 
Posts: 11
Default IF statement problem

I am a fool the reason it wasn't working was that that it went

{IF {{MERGEFIELD"CountOfMessage"}} = 500
^^
too many brackets

Regarding my other problem it is a rounding problem but since it is going to
be rounded down it could be truncated. I just don't know how to do it. Also I
need to add digits to some numbers, for example, if i have 2 i need 2.00.
Maybe this could be done with truncation as well.

Thanks,

S


"Peter Jamieson" wrote:

What does the code in your IF field look like at the moment?

Also I need to round a number down to the nearest 0.01(its a price). Does


Have you tried the usualy formatting switches, or is the problem rounding
rather than truncation?

--
Peter Jamieson
http://tips.pjmsn.me.uk

"projectmergeleader" wrote in
message ...
I am writing a mail merge project to create a number of invoices from a
database created in access. I need to check a number that I obtained using
a
count statement to see if it is between certain boundaries. When I try to
do
this it does not work and the else staement is always executed. It may be
because the number is stored as text but even direct comparison doesn't
work.

Also I need to round a number down to the nearest 0.01(its a price). Does
anyone know how to achieve this?

Thanks in advance,

S



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default IF statement problem

Instead of

{ MERGEFIELD mynumber }

try

{ MERGEFIELD mynumber \#0.00 }

--
Peter Jamieson
http://tips.pjmsn.me.uk

"projectmergeleader" wrote in
message ...
I am a fool the reason it wasn't working was that that it went

{IF {{MERGEFIELD"CountOfMessage"}} = 500
^^
too many brackets

Regarding my other problem it is a rounding problem but since it is going
to
be rounded down it could be truncated. I just don't know how to do it.
Also I
need to add digits to some numbers, for example, if i have 2 i need 2.00.
Maybe this could be done with truncation as well.

Thanks,

S


"Peter Jamieson" wrote:

What does the code in your IF field look like at the moment?

Also I need to round a number down to the nearest 0.01(its a price).
Does


Have you tried the usualy formatting switches, or is the problem rounding
rather than truncation?

--
Peter Jamieson
http://tips.pjmsn.me.uk

"projectmergeleader" wrote
in
message ...
I am writing a mail merge project to create a number of invoices from a
database created in access. I need to check a number that I obtained
using
a
count statement to see if it is between certain boundaries. When I try
to
do
this it does not work and the else staement is always executed. It may
be
because the number is stored as text but even direct comparison doesn't
work.

Also I need to round a number down to the nearest 0.01(its a price).
Does
anyone know how to achieve this?

Thanks in advance,

S




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
IF statement Paul J Microsoft Word Help 11 May 14th 07 06:04 PM
which statement right , question is Choose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 16th 06 11:15 AM
which statement right , question isChoose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 15th 06 11:20 PM
problem with if statement [email protected] Microsoft Word Help 1 August 24th 06 12:13 AM
IF statement problem !Syntax Error, ! jlawson Microsoft Word Help 7 July 12th 06 03:42 PM


All times are GMT +1. The time now is 10:08 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"