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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word - Merge if...than...else statements 1

Status
Not open for further replies.

O2BNSV

Technical User
Jun 29, 2006
104
US
There are merge field operators available in word 2003. ONe that I use with some frequency is the If...then...else. I need to somehow create an if...than...else that runs of a date. I have created the following:

{IF{MERGEFIELD CnMem_1_01_Cur_Expires_On} <= "datevalue(5/19/2008)" "" "Membership expiration date"}

Basically, I need to compare the two dates, which are actually text fields and return either a null value or a a text value depending. Is there a way to do this with the if...than...else structure?

 
Hi O2BNSV,

You could code your field as:
{IF{MERGEFIELD CnMem_1_01_Cur_Expires_On \@ YYYYMMDD}> 20080519 "Membership expiration date"}

I suspect from your example that the date being compared is also variable. To see how to make that date change each month, and how to do just about everything else you might want to do with dates in Word, check out my Date Calc 'tutorial', at:
or


Cheers

[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top