Display non double rows in browser!

make

Member
Hi there,
I have a table, named "Art" and a browser who can work with a freeform-query.
My table contains more than rows with the same value:
Example :

Nr Shipped
------ -----------
110 50
110 55
110 50
110 60
110 55
110 50
110 60
110 55


You see my problem ?
I want to display only one of each values:

Nr Shipped
----- ------------
110 50
110 55
110 60


What kind of query do i have to make ?


Greets
 

vakpal

Member
Hi!

Difficult problem. :)

This is the solution (My solution). :

DEFINE WORK-TABLE WT_Table
FIELD Fld1 AS INTEGER.

ON FIND OF DBTable
DO:
IF AVAILABLE DBTable THEN
DO:
FIND FIRST WT_Table NO-LOCK
WHERE WT_Table.Fld1 = DBTable.Fld2
NO-ERROR.
IF NOT AVAILABLE WT_table THEN
DO:
CREATE WT_Table.
ASSIGN WT_Table.Fld1 = DBTable.Fld2.
FIND CURRENT WT_Table NO-LOCK NO-ERROR.
END.
END.
END.

FOR EACH DBTable NO-LOCK
WHERE NOT CAN-FIND(FIRST WT_Table NO-LOCK
WHERE WT_Table.Fld1 = DBTable.Fld2) :
DISPLAY DBTable.
END.

Wooops!
CAN-FIND not working on OPEN QUERY. :-(
Sorry!
 

chrisk01

New Member
Another option is to use a find trigger on the table.

on find of <i>table name</i>:
if can-find record with same details
return error.

end.

The records you find and return error on will not be displayed in the browse.
 
Top