The IN command in Navision

sabzamsabzam Member Posts: 1,149
Select * from [Cronus$Sales Line] where [No_] in
(Select distinct [No_] from [Cronus$Item])

Hi Everybody,

I need to recreate a similar coding to the above sql statement in Navision. I know that it can be done by setfilter but the could would certainly not look that great. Is there a reserved word in Navision which replaces the IN used in sql?

Comments

  • easabanganeasabangan Member Posts: 114
    If Cronus_Customer.FIND('-') THEN
      REPEAT
         Cronus_SalesHeader.SETRANGE("Bill-to Customer No.", Customer."No.");
         IF Cronus_SalesHeader.FIND('-') THEN BEGIN
           //Do your codes here
         END;
      UNTIL  Cronus_Customer.NEXT = 0;
    

    something like this code.
    No future at CPI
  • easabanganeasabangan Member Posts: 114
    CLEAR(Cronus_SalesHeader); //insert this line before the code
    Cronus_SalesHeader.SETRANGE("Bill-to Customer No.", Customer."No.");
    No future at CPI
  • David_CoxDavid_Cox Member Posts: 509
    easabangan wrote:
    CLEAR(Cronus_SalesHeader); //insert this line before the code
    Cronus_SalesHeader.SETRANGE("Bill-to Customer No.", Customer."No.");

    You do not need the Clear or reset, if you are changing the filter on the same field.
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • easabanganeasabangan Member Posts: 114
    You do not need the Clear or reset, if you are changing the filter on the same field.

    What if you the he/she added new codes for filtering in other field under the codes that I have given. That filtering will be taken through the 2,3,4th etc. loop. :lol: [/quote]
    No future at CPI
Sign In or Register to comment.