Is there no "Date/Time" stamp when records are edited?
if the records are stored sequentially on entering and leaving....how do you avoid a "duplicate key" error?
Is there another key field added to this "journaling" table?
If so...then perhaps you can then run a report using the Primary keys of the original table. There will
ALWAYSbe 2 records of each (one entering and one leaving).
Then group by a single formula based on the primary keys
@grouping
//I usually separate each with a "/" for debug purposes
//hopefully the resulting string is less than 254 chars
//if it isn't then you will need more groupings
{table.primarykey1} + "/" +
//make them all text so if any keys are numeric use ToText
totext({table.primarykey2}) + "/" +
...add the rest of the keys...
Now we only want records that have changed so we want to store the first record...then compare the second record and print both records if they are not the same
you can use arrays for this one array for record1 and one for record2. Put a flag in the report header
@SetFlag (suppressed in report header)
WhilePrintingRecords;
numbervar resetFlag := 0;
@initialization (suppressed in the group header)
WhilePrintingRecords;
numbervar resetFlag ;
//make arraystext and have an element for each field of the record
if resetFlag = 0 then
(
stringVar array record1 := ["","","","".....""];
stringVar array record2 := ["","","","".....""];
);
Now a formula to store the array values
@store (suppressed in the detail section)
WhilePrintingRecords;
numbervar resetFlag ;
stringVar array record1 ;
stringVar array record2 ;
if resetFlag = 0 then
(
//assign the record fields to each element of record 1
//if the fields are numeric use Totext
record1[1] := {table.field1};
record1[2] := totext({table.field2});
record1[3] := {table.field3};
record1[4] := {table.field4};
... assign the rest here...
ResetFlag := 1;
)
else
(
//assign the record fields to each element of record 2
//if the fields are numeric use Totext
record2[1] := {table.field1};
record2[2] := totext({table.field2});
record2[3] := {table.field3};
record2[4] := {table.field4};
... assign the rest here...
ResetFlag := 0; //to reinitialize a new array set
)
Now in the group footer place the display of each array
it is probably best to have a footer subsection for each array. In the Group header you can put column labels for each array element.
@displayRecord1 (placed in group footer subsection A)
WhilePrintingRecords;
stringVar array record1 ;
//this assumes the the result is less than 254 chars
Join(record1," "

;
Put a conditional suppress on the field
WhilePrintingRecords;
numbervar resetFlag ;
resetFlag = 1;
do the same in Section B for the other array
Now in the Section expert for the entire group footer, in the conditional suppress use the formula
WhilePrintingRecords;
booleanVar Suppressflag := true;
numbervar resetFlag ;
stringVar array record1 ;
stringVar array record2 ;
numberVar icount;
if resetFlag = 0 then
(
for icount := 1 to ubound(record1) do
(
if record1[icount] <> record2[icount] then
(
Suppressflag := False;
exit for;
);
);
);
Suppressflag;
There....I think that will give you an idea of one approach. You haven't given a lot of details on the size of these tables...both number of records and number of fields/record.
Of course if there is a timestamp field if the record is edited in your "journaling" table then the above is not necessary...you would only compare timestamps
Hope this gives you some ideas
Jim Broadbent