Conditional If statement

M

Maria

I am working on a mail merge label that if the Age field is less than 13 the
ParentName field needs to appear underneath the ChildName field.

The If statement below is working correctly if there is a figure in Age
however, if that field is blank it is creating a blank label with the
ParentName in it.

{If < "13" "{mergefield ParentName}" ""}

Any ideas would be greatly appreciated. Thanks
 
M

macropod

Hi Maria,

If your Age field is empty, it should evaluate to 0, so the parent's name would be expected to appear in such cases. But so should
the child's name, so I don't understand the bit about the "blank label with the ParentName in it". Perhaps you could give a bit more
explanation about this.

If you're simply trying to suppress the parent's name when the child's age is missing, try:
{IF{MERGEFIELD Age}> 0 {IF{MERGEFIELD Age}< 13 {MERGEFIELD ParentName}}}

Cheers
 
M

Maria

Thank you very much, that was also what needed to be accomplished, if there
was no Age then it should be blank instead of returning the parentname. Your
input was greatly appreciated and your if statement worked correctly.

Thanks again.

macropod said:
Hi Maria,

If your Age field is empty, it should evaluate to 0, so the parent's name would be expected to appear in such cases. But so should
the child's name, so I don't understand the bit about the "blank label with the ParentName in it". Perhaps you could give a bit more
explanation about this.

If you're simply trying to suppress the parent's name when the child's age is missing, try:
{IF{MERGEFIELD Age}> 0 {IF{MERGEFIELD Age}< 13 {MERGEFIELD ParentName}}}

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Maria said:
I am working on a mail merge label that if the Age field is less than 13 the
ParentName field needs to appear underneath the ChildName field.

The If statement below is working correctly if there is a figure in Age
however, if that field is blank it is creating a blank label with the
ParentName in it.

{If < "13" "{mergefield ParentName}" ""}

Any ideas would be greatly appreciated. Thanks
 
Top