Inserting Distinct Values in table at runtime

aman_mbs
aman_mbs Member Posts: 158
Dear All,
I have made a temp table that will be filled at the runtime i only want the record that r distinct to be filled in the table...
Aman Kumar Gupta

Comments

  • ara3n
    ara3n Member Posts: 9,258
    well set filters on the table.

    temptable.setrange.(field1,'blah');
    if temptable.findfirst then begin
    temptable.field2 += 1212;
    temptable.modify;
    end else begin
    temptable.field1 := 'blah';
    temptable.insert;
    end;
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • aman_mbs
    aman_mbs Member Posts: 158
    Dear Sir,

    Thanks For the reply....

    According to my situation i have made a table containing 25 columns and this table is created when one of my report will run and i want when this report runs every column of the table to be filled with unique values at runtime. In this table there will be only one row.

    Deep Regards,
    Aman Kumar Gupta
  • ara3n
    ara3n Member Posts: 9,258
    Well in that case, you need a big case statement and fill each column. I don't know why you would need a table for that. You could create an array.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • aman_mbs
    aman_mbs Member Posts: 158
    Dear Sir,
    Thanks a ton sir, I too solved my problem with Case Statement... i have tried this thing with arrays to but it dint work out..

    Regards,
    Aman Kumar Gupta
  • ara3n
    ara3n Member Posts: 9,258
    you are welcome. If you want to see how to use array. Post your case statement in here and I will translate it into an array.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n