Question about IF & INCLUDETEXT with a number range

H

Heather

Me again. My merge questions just keep on coming.

I'm still working with IF and INCLUDETEXT statements to build admission
letters for students. I'm working on a statement that looks at the
admission average and determines which admission award to give. The
first range of averages would be from 80.0-84.9%, then 85.0-89.9%, and
then 90% and above. The averages reported appear in my gigantic (so
gigantor I can't open it in Excel) csv file. Here's the kicker - the
average can appear in one of six positions in the csv file.

So I've got this so far:

{if {mergefield admittype}="HS" {if {mergefield evalcmp111}="2010" {if
{mergefield evalcmpvalue111}>="80"{if {mergefield
evalcmp111}<="84.9"{includetext c:\\master_comment.doc
admission_award}""}""}""}""}

Which, naturally, isn't working when I test it...is it just my spacing?
Is there a better way to do this?

Thanks again for your help...it is greatly appreciated.

Heather
 
H

Heather

Squee! I answered my own question.

{if {mergefield admittype}="HS" {if {mergefield evalcmp111}="2010" {if
{mergefield evalcmpvalue111}>="80" {if {mergefield
evalcmpvalue111}<"85" {includetext c:\\master_comment.doc
admission_award_80_to_84} ""} ""} ""} ""}

....with five more instances (using evalcmp111, 112, 113, etc) to
account for each case of 80.0-84.9% average. And then rinse, repeat,
and six more big IFs for the 85-89%.

Is there any difference between entering 80.0 and 80?

Go live is now in...8 days, 22 hours, 14 minutes. Me stressed?
Noooooo...

:)

Heather
 
P

Peter Jamieson

Is there any difference between entering 80.0 and 80?

Maybe - tests in IF fields tend to be textual rather than numeric,
especially if you quote the second comparand. In this case it may work
whatever the value, but if you test and discover that isn't so, you may be
able to use { = } field to do the comparison.

Personally, I would double quote text operands. Some programmers seem to
tegard them as redundant because the IF typically works without them, but
they are not - in some circumstances behaviour is different when you leave
them out. But the following is mainly just my personal preference (the line
breaks and spacing on the left hand side of the lines are just for
presentation purposes):

{ IF "{MERGEFIELD admittype }" = "HS"
"{ IF "{ MERGEFIELD evalcmp111 }" = "2010"
"{ IF "{ MERGEFIELD evalcmpvalue111 }" >= "80"
"{ IF "{ MERGEFIELD evalcmpvalue111 }" < "85"
"{ INCLUDETEXT "c:\\master_comment.doc" admission_award_80_to_84}"
"" }"
"" }"
"" }"
"" }

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Lengthy merge code 12

Top