looping through a table to get data for a specific employee

FreakyFreaky Member Posts: 125
Hi Guys,
I created a report using a table called "History" and i am using the get function to get info from another table called the "exta pay". On the extrapay table there are a fields called "empid","paymodelId" and "amount".Now one "empid" can have one paymodelID and another on rows.My problem is that I cannot dispaly all those PaymodelIDs as well as their amounts for one particular empid on the Report. Can any help please.
The report should look like this
empid paymodelID amount
a0001 1 400
a0001 2 500
a0001 3 600
:-k
Thanks in advance.

Comments

  • garakgarak Member Posts: 3,263
    to confused. Let's see your source.
    Is the problem the report design or your source (the get statement) self?
    Do you make it right, it works too!
  • FreakyFreaky Member Posts: 125
    //Getting the amount
    expay.GET(id); //From history table
    expay1:=0;
    expay.RESET; //"Extra pay" table
    expay.SETRANGE(empid,History.empid);
    IF expay.FINDSET THEN
    REPEAT
    expay1:=expay.Amount;
    UNTIL expay.NEXT=0;

    //Getting the paymodelID
    Expaymodel.GET(id); //From history table
    paymod:=0;
    Expaymodel.RESET; //"Extra pay model" table
    Expaymodel.SETRANGE(empid,History.empid);
    IF Expaymodel.FINDSET THEN
    REPEAT
    paymod:=Expaymodel.paymodelID;
    UNTIL Expaymodel.NEXT=0;


    Now what happens is that it only gives me the first amount or paymodelID of a particular employee.It does not display all amounts and paymodelIDs. It is placed on the > history, Body(1) section of the report.

    I hope this helps.
  • garakgarak Member Posts: 3,263
    first, your source is wrong for this what you "need"
    second, why do you not use a separete DataItem and link it with your first DataItem?
    Do you make it right, it works too!
  • FreakyFreaky Member Posts: 125
    Thanks i will try that.
Sign In or Register to comment.