Select distinct

Posted by Admin on 29-Aug-2008 10:13

I use Progress report tool called Result to create some queries and out put to a txt file.

But I see many duplicated records in the result.

I cannot find there is a way like select distinct rows for the reports.

How can I eliminate the duplicated records or how can I use distinct to only choose distinct rows?

All Replies

Posted by rstanciu on 03-Sep-2008 09:27

You have to create your own 4GL procedure like:

/* selectDistinct.p */

DEFINE STREAM ls.

&SCOPED-DEFINE OUT PUT STREAM ls UNFORMATTED

OUTPUT STREAM ls TO "test.txt".

FOR EACH Customer NO-LOCK BREAK BY Customer.Name BY Customer.City:

IF FIRST-OF(Customer.Name) THEN DO:

STRING(Customer.CustNum,"9999999").

Customer.Name AT 10.

Customer.City AT 50 SKIP.

END.

END.

OUTPUT STREAM ls CLOSE.

save the file into results directory and add a user option (see image 1) with the name of you

custom procedure. After that the opetion is visible all the time (see image 2)

This thread is closed