Filtering

valkatamake
valkatamake Member Posts: 38
help me with this please
I have table that i need to filter
Example

TABLE
Code Description Number
AAAA doesn't matter doesn't matter
AAAA
AAAA
BBBB
BBBB
CCCC
CCCC
CCCC
CCCC

form must show me

CODE DESCRIPTION
AAAA
BBBB
CCCC

Comments

  • Belias
    Belias Member Posts: 2,998
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • JedrzejT
    JedrzejT Member Posts: 267
    In Code:

    rec.SETFILTER(code,'%1|%2|%3','AAAA','BBBB','CCCC');

    On Form:

    Field | Filter
    Code | AAAA|BBBB|CCCC
  • Belias
    Belias Member Posts: 2,998
    JedrzejT wrote:
    In Code:

    rec.SETFILTER(code,'%1|%2|%3','AAAA','BBBB','CCCC');

    On Form:

    Field | Filter
    Code | AAAA|BBBB|CCCC

    [-X
    i think he means one line for each code,
    like a "SELECT DISTINCT" in sql...
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • valkatamake
    valkatamake Member Posts: 38
    this is not the idea
    if i have table "who is entering the building" (for example) and i have

    john
    adam
    adam
    adam
    john
    maria
    maria
    john

    in the table could be milion records but only 5 names and i want to show me only uniques records ...
  • Belias
    Belias Member Posts: 2,998
    ehm...try following the link above... :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • JedrzejT
    JedrzejT Member Posts: 267
    ](*,) sorry..
  • garak
    garak Member Posts: 3,263
    edited 2008-07-04
    in my meaning you need a DISTINCT like under sql. so you can store the data, before viewing, in a tempTable and show than the temp.Table

    But, other question: why do you store the data in this style :?: I think here the "Number" is your Primary Key. Why not the Code :?: Whats the reason :?:
    Do you make it right, it works too!
  • valkatamake
    valkatamake Member Posts: 38
    keys : Code, Description and last number ...
  • kine
    kine Member Posts: 12,562
    This "Disctinct" problem is because the data are not normalized. Best is to have separate table where you will add the code each time you create some new entry and the code doesn't exists. Than you can make form over this table and you are done.

    It means that you have table with "who enters" but you have second table "People" where you have list all names who ever entered...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • valkatamake
    valkatamake Member Posts: 38
    at least tell me how to check

    If first record = second record
    if john = adam ... :?: :-k