Unique Record Filtering

LambaLamba Member Posts: 260
Hi,
I need to filter the main project and show the data in excel filtering on date range, the condition is the same name must not repeat

Eg: In this case the name "BEAS PROJECTS - DIRECT" comes twice, it must come once..
I tried following code:


i := 1;
Rec50023.RESET;
Rec50023.SETRANGE("Start Date",StartDate,EndDate);
IF Rec50023.FINDFIRST THEN
BEGIN
MainProject := Rec50023."Main Project";
REPEAT
Rec50023_1.RESET;
Rec50023_1.SETRANGE("Main Project",'%1',MainProject);
IF Rec50023_1.FINDFIRST THEN
MainProjectFinal := Rec50023_1."Main Project";
i := i + 1;
UNTIL Rec50023.NEXT = 0;
END;

On putting message the same project name is repeating, i know why as per the assignment in the following code:

MainProject := Rec50023."Main Project";

what must i do, so it takes the next Main Project name and any name must not repeat itself.

Comments

Sign In or Register to comment.