mac100
mac100

Reputation: 137

How to count the occurrence of record in field2 of a table based on field1 in progress openedge 4 gl?

I have a table with two fields.

I need to count occurence of data of field2 based on field1 . Like a(field1) - x(field2) - 1(occurrence of x for a ) , a - y - 2 , b-z-1 for all a b c d

Upvotes: 0

Views: 83

Answers (1)

mac100
mac100

Reputation: 137

Solved this problem :

DEFINE VARIABLE i AS INTEGER     NO-UNDO.
FOR EACH ttPTdetails NO-LOCK BREAK BY ttPTdetails.sentdate BY stat :

     i = i + 1.
    IF LAST-OF(stat) THEN DO:
        DISPLAY  ttPTdetails.sentdate  (ttPTdetails.stat ) i.
        i = 0.
    END.    
END. 

Upvotes: 0

Related Questions