#1
|
|||
|
|||
Syntax Help Needed for Using AND Statement in NEXIF
I'm a new member with a burning question!
Can anyone PLEASE help me figure this one out? I've been searching via Google for hours to no avail. I'm trying to figure out the correct syntax in MS Word 2007 to do a SKIPIF if ALL of the following are true. { SKIPIF { MERGEFIELD field1 }= "" } { SKIPIF { MERGEFIELD field2 }= "" } { SKIPIF { MERGEFIELD field3 }= "" } { SKIPIF { MERGEFIELD field4 }= "" } Any ideas? Thanks a bunch! |
#2
|
||||
|
||||
Hi Rob,
You've got the basic construction OK. The code says to skip the record if any of the fields 1-4 is empty. Is that what you're trying to achieve?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
I'd like it to skip if ALL of them are empty. Otherwise I want it to print.
|
#4
|
||||
|
||||
Hi Rob,
In that case, you need something like: {SKIPIF{={IF{MERGEFIELD field1}= "" 0 1}+{IF{MERGEFIELD field2}= "" 0 1}+{IF{MERGEFIELD field3}= "" 0 1}+{IF{MERGEFIELD field4}= "" 0 1}}= 0} If your mergefields have numeric values, the field code could be simplified somewhat.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Hrrm. I tried it and that didn't work. I'm searching through text fields. Here's the exact syntax I'm using. Am I missing a space or bracket?
{ SKIPIF {={ IF {MERGEFIELD attendance_comments}= "" 0 1}+{IF { MERGEFIELD assignment_comments}= "" 0 1}+{ IF { MERGEFIELD grading_comments}= "" 0 1}+{IF { MERGEFIELD submit_grades_comments}= "" 0 1}+{ IF { MERGEFIELD report_comments}= "" 0 1}+{ IF { MERGEFIELD parent_access_comments}= "" 0 1}+{ IF { MERGEFIELD Please_share_any_additional_feature_req}= "" 0 1}}= 0 } |
#6
|
|||
|
|||
And I've also tried dumping all of the spaces I added to mimic your suggestion more closely:
{SKIPIF{={IF{MERGEFIELD attendance_comments}= "" 0 1}+{IF{MERGEFIELD assignment_comments}= "" 0 1}+{IF{MERGEFIELD grading_comments}= "" 0 1}+{IF{MERGEFIELD submit_grades_comments}= "" 0 1}+{IF{MERGEFIELD report_comments}= "" 0 1}+{IF{MERGEFIELD parent_access_comments}= "" 0 1}+{IF{MERGEFIELD Please_share_any_additional_feature_req}= "" 0 1}}= 0} |
#7
|
||||
|
||||
Hi Rob,
Your field construction is just fine. Did you use Ctrl-F9 for all the field brace pairs (ie '{}')? There's a macro I wrote for converting the textual field representation into true fields at: http://www.gmayor.com/export_field.htm#TextToField
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
Awesome! Between the converter Macro and your syntax I've gotten it working. You're the best!
|
#9
|
|||
|
|||
Quote:
{ SKIPIF { = {IF {mergefield} < 1000 "0" "1" } + { IF {mergefield} < 2 "0" "1" } = "0" } Can you identify any issues with this? Many thanks! |
#10
|
||||
|
||||
Hi surrendetoo,
You need to specifiy the data field names for the test. Also, you can eliminate the double quotes: {SKIPIF {={IF{MERGEFIELD Fld1Nm}< 1000 0 1}+{IF{MERGEFIELD Fld2Nm}< 2 0 1}= 0} where Fld1Nm and Fld2Nm are your data field names (they can be the same).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
Thanks macropod, but I'm still not having success. Would you mind reviewing one more time for any errors?
{SKIPIF{ ={IF { MERGEFIELD field_1}< 10000 0 1 }+{ IF{ MERGEFIELD field_2 }< 2 0 1 }= 0 }} Thank you! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't seem to get the correct syntax for Wine list mailmerge | daym | Mail Merge | 3 | 05-02-2011 03:26 AM |
Help with IF Statement | limpbizkit | Excel | 4 | 02-24-2011 09:16 PM |
if statement | piper7971 | PowerPoint | 1 | 08-19-2010 07:10 AM |
Help with IF statement! | CPelkey | Word | 1 | 04-12-2010 09:06 AM |
Syntax help needed | blazzercat | Excel | 3 | 07-09-2009 02:15 PM |