Find the last entry with the exception of a specific value

AgnethefAgnethef Member Posts: 18
Hi,

I need to find the last record in a table (Res) with the entry: (Number:41, Type:42)

I use the following code:

Res.RESET;
Res.SETRANGE(Number, 41);
Res.SETRANGE(Type, 42);
IF Res.FIND('+') THEN BEGIN...................etc.

However, I would like to exclude the following value: (Number:4, Type:6) in the search. How can I do that?

Thank you in advance.
Agnethef

Comments

  • lvanvugtlvanvugt Member Posts: 774
    Hi Agnethef,

    Maybe I misunderstand your query, but if you set your filtering like this:
    Res.SETRANGE(Number, 41);
    Res.SETRANGE(Type, 42);
    
    The record set will only include records having both these values
    So requesting ...
    Agnethef wrote:
    ... to exclude the following value: (Number:4, Type:6) in the search.
    ... sounds useless to me.
    Or do you mean include instead of exclude?
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • FSmeetsFSmeets Member Posts: 37
    Probably I don't get it as well, but why not using the standard filtering option in Navision and then go to the last record?
    Set filter on number: <>4 and type: <>6

    Maybe you can explain it a bit more?
  • AgnethefAgnethef Member Posts: 18
    Thank you very much for your replies.

    I did not explain it well enough but anyhow your answers gave me the idea of how to fix the problem, so thank you for your help.
  • lvanvugtlvanvugt Member Posts: 774
    Agnethef,

    To make this post of value to all on the forum please explain your ...
    Agnethef wrote:
    ... idea of how to fix the problem ...
    That's why we are having this forum (also) :!:
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
Sign In or Register to comment.