LinkCriteria with AND

  • Thread starter Thread starter NetworkTrade
  • Start date Start date
N

NetworkTrade

having a syntax brain freeze....

this works fine:

stLinkCriteria = "[ID]Not Like 'I*'"

All IDs show on the opening report - except those that start with an I

and now I need to make both Not Like I and Not Like G

so that all IDs show on opening report except those that start with I or G

I think I'm wrestling with the " symbol.....
 
NetworkTrade said:
having a syntax brain freeze....

this works fine:

stLinkCriteria = "[ID]Not Like 'I*'"

All IDs show on the opening report - except those that start with an I

and now I need to make both Not Like I and Not Like G

so that all IDs show on opening report except those that start with I or G

I think I'm wrestling with the " symbol.....


You could do this:

stLinkCriteria = "[ID] Not Like 'I*' AND [ID] Not Like 'G*'"

Or, taking advantage of a different variation of the pattern-matching
afforded by the Like operator, you could do this:

stLinkCriteria = "[ID] Like '[!IG]*'"
 
well it is funny ; the first method you gave I immediately said to myself
that I had already tried that and it did not work......but I tried it again
and it worked....so I really did have a brain freeze going...

the second method was new to me; it works too and is very efficient - so am
going file that one into the memory bank.

gracias....
--
NTC


Dirk Goldgar said:
NetworkTrade said:
having a syntax brain freeze....

this works fine:

stLinkCriteria = "[ID]Not Like 'I*'"

All IDs show on the opening report - except those that start with an I

and now I need to make both Not Like I and Not Like G

so that all IDs show on opening report except those that start with I or G

I think I'm wrestling with the " symbol.....


You could do this:

stLinkCriteria = "[ID] Not Like 'I*' AND [ID] Not Like 'G*'"

Or, taking advantage of a different variation of the pattern-matching
afforded by the Like operator, you could do this:

stLinkCriteria = "[ID] Like '[!IG]*'"


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top