Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word - ail merge condition

Status
Not open for further replies.

royalcheese

Technical User
Dec 5, 2005
111
GB
Hi all

Im tring to write a conditional statement for a field called years. e.g

So if the years is 0 then nothing will appear including the 0,

if it is 1 then , "1 year" will be shown.

and 2+ will be "2 years" .

Please can any one point me in the direction of conditional statements ?

Thanks in Advance


Chris
 

{IF {MERGEFIELD Year} = 0 "" {MERGEFIELD Year} = 1
"1 year" "2 years}}

I find the esiest way to do this is to use Insert Word field for the first part - with If ... Then ... Else, so that you get:
{IF {MERGEFIELD Year} = 0 "" ""}
and then replace the second pair of quotes by
{IF {MERGEFIELD Year} = 1 "1 year" "2 years"}.

HTH

Ilse
 
A simpler solution would be:
{={MERGEFIELD Year}-1 \# 2\ Years;;1\ Year}

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top