Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: Comparison problem w/SkipIf

Geek News

Comparison problem w/SkipIf
"RobWN" <NotLikely[ at ]mts.net> 11/27/2008 12:40:14 AM
Word/Xl '03
The merge data in xl is formatted as General and is in the form of ####-###.
I want the record(s) to be skipped if the value is less than a specific value, for ex
Skipif field is < "1000-999"
The merge doesn't seem to recognize > or < operators (only =).
I tried changing the format in xl to Text (and re-entered the value) - no effect.

What am I missing?
--
Regards
Rob


Re: Comparison problem w/SkipIf
"Graham Mayor" <gmayor[ at ]REMOVETHISmvps.org> 11/27/2008 6:50:59 AM
You can't use a numeric operator with text field data.
How does the sequence run with respect to the two numbers separated by a
hyphen?
As you have it the field is undoubtedly substracting 999 from 1000 so you
are searching for SKIPIF Field < 1
There are two solutions that sprint to mind
1. Remove the hyphen from the Excel data source and format the number in
Word with a switch - \# "0000'-'000" where you require the number to be
placed but you can then use your skipif field < "1000999"
2. Add two columns to the data source to contain the two parts of the number
without the hyphen.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



RobWN wrote:
[Quoted Text]
> Word/Xl '03
> The merge data in xl is formatted as General and is in the form of
> ####-###. I want the record(s) to be skipped if the value is less than a
> specific value, for ex Skipif field is < "1000-999"
> The merge doesn't seem to recognize > or < operators (only =).
> I tried changing the format in xl to Text (and re-entered the value)
> - no effect.
> What am I missing?


Re: Comparison problem w/SkipIf
"RobWN" <NotLikely[ at ]mts.net> 11/27/2008 11:37:16 PM
Thanks Graham, you gave me the hint I needed (I was seeing the dash as a hyphen, Word thinks
it's a minus-even if xl doesn't.
FWIW they are Company-Division numbers.

I can't (don't want to) change the xl data for a variety of reasons-mainly because the file is
used by a number of apps..

However I found another field I could use-each record has an id field formatted as
####AAAAAA####.
the 1st four #'s are the same as the 1st four in my original e-mail, the alpha's are a portion
of last/first names and the trailing #'s are Year/Mo.

I simply had to change the instruction to SkipIf field <= 1000ZZZZZZ9999 and presto!

Again, thanks for the wakeup call!
--
Regards
Rob
"Graham Mayor" <gmayor[ at ]REMOVETHISmvps.org> wrote in message
news:%23WcQAyFUJHA.1332[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> You can't use a numeric operator with text field data.
> How does the sequence run with respect to the two numbers separated by a hyphen?
> As you have it the field is undoubtedly substracting 999 from 1000 so you are searching for
> SKIPIF Field < 1
> There are two solutions that sprint to mind
> 1. Remove the hyphen from the Excel data source and format the number in Word with a switch -
> \# "0000'-'000" where you require the number to be placed but you can then use your skipif
> field < "1000999"
> 2. Add two columns to the data source to contain the two parts of the number without the
> hyphen.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
>
> RobWN wrote:
>> Word/Xl '03
>> The merge data in xl is formatted as General and is in the form of
>> ####-###. I want the record(s) to be skipped if the value is less than a
>> specific value, for ex Skipif field is < "1000-999"
>> The merge doesn't seem to recognize > or < operators (only =).
>> I tried changing the format in xl to Text (and re-entered the value)
>> - no effect.
>> What am I missing?
>
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net