SETRANGE & |

JKoBJKoB Member Posts: 40
Hey!

How can i use SETRANGE with 2 criteria?

Present Code: SETFILTER("Location Code",'<>%1','Loc1');

Should be expanded to "Loc1|Loc2"

Thx in advance...

Jakob

Answers

  • idiotidiot Member Posts: 651
    SETFILTER("Location Code",'%1|%2','Loc1','Loc2');
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • garakgarak Member Posts: 3,263
    you can't use setrange ;-) u must use setfilter.
    setfilter(MyField,'%1|%2|%3','Bla','Blup','Gurkenrost');
    //or
    setfilter(MyField,'Bla|Blup|Gurkenrost');
    //or
    MyFilterstr := 'Bla|Blup|Gurkenrost';
    setfilter(MyField,MyFilterStr);
    

    follow also the link
    viewtopic.php?f=23&t=26739


    Regards
    Regards
    Do you make it right, it works too!
  • JKoBJKoB Member Posts: 40
    Hmmm...
    setfilter(MyField,'%1|%2|%3','Bla','Blup','Gurkenrost');
    
    doesnt work...

    cause i need the "<>" (<>hannover|Kröpke)

    Setfilter was clear so far (just made a typing error)
  • garakgarak Member Posts: 3,263
    edited 2009-02-06
    JKoB wrote:
    Hmmm...
    cause i need the "<>" (<>hannover|Kröpke)


    Hannover without the Kröpke? Never [-X :-D

    use this:
    setfilter(MyField,'<>%1&<>%2','HannoverRules','Kröpke');
    

    for the other example:
    setfilter(MyField,'<>%1&<>%2&<>%3','Bla','Blup','Gurkenrost');
    

    Regards
    Do you make it right, it works too!
  • navuser1navuser1 Member Posts: 1,329
    JKoB wrote:
    Hmmm...
    setfilter(MyField,'%1|%2|%3','Bla','Blup','Gurkenrost');
    
    doesnt work...

    cause i need the "<>" (<>hannover|Kröpke)

    Setfilter was clear so far (just made a typing error)


    you are asking for not equal to ...Then try
    SETFILTER(MyField,'<>%1|<>%2|<>%3','Bla','Blup','Gurkenrost')
    Now or Never
  • MBergerMBerger Member Posts: 413
    navuser1 wrote:
    JKoB wrote:
    Hmmm...
    setfilter(MyField,'%1|%2|%3','Bla','Blup','Gurkenrost');
    
    doesnt work...

    cause i need the "<>" (<>hannover|Kröpke)

    Setfilter was clear so far (just made a typing error)


    you are asking for not equal to ...Then try
    SETFILTER(MyField,'<>%1|<>%2|<>%3','Bla','Blup','Gurkenrost')
    That won't work, because Blup IS not equal to Bla, it will still pass. As stated in a previous post, you need to use <>%1&<>%2&<>%3
  • navuser1navuser1 Member Posts: 1,329
    MBerger wrote:
    navuser1 wrote:
    JKoB wrote:
    Hmmm...
    setfilter(MyField,'%1|%2|%3','Bla','Blup','Gurkenrost');
    
    doesnt work...

    cause i need the "<>" (<>hannover|Kröpke)

    Setfilter was clear so far (just made a typing error)


    you are asking for not equal to ...Then try
    SETFILTER(MyField,'<>%1|<>%2|<>%3','Bla','Blup','Gurkenrost')
    That won't work, because Blup IS not equal to Bla, it will still pass. As stated in a previous post, you need to use <>%1&<>%2&<>%3

    Ouch.
    BIG Mistake :mrgreen:
    Now or Never
  • JKoBJKoB Member Posts: 40
    garak wrote:
    JKoB wrote:
    Hmmm...
    cause i need the "<>" (<>hannover|Kröpke)


    Hannover without the Kröpke? Never [-X :-D
    setfilter(MyField,'<>%1&<>%2','HannoverRules','Kröpke');
    

    Regards

    works pretty fine... Thx

    last thing 2 say:
    '<>%1&<>%2','Hannover','Kröpke' := '<>%1&<>%2','Hamburg','Reeperbahn' 8)

    [Solved]
Sign In or Register to comment.