Group by MAX

Posted by Admin on 19-Feb-2008 03:26

Hi....I need some help again.

I've got a table with tel no's. In this table are fields called tel_obj,cust_id and the tel details. Tel_obj increases when tel no's are updated. So 1 customer could end up with 5 records in the table, of which only the last record is significant. I tried using FIND LAST, but the results are not that accurate. In access I group it by the MAX tel_obj, the assign the MAX tel_obj to the relevant cust_id record in the temp table. Any ideas on how to do this in progress??

All Replies

Posted by Thomas Mercer-Hursh on 19-Feb-2008 10:55

Rather than use find last, do a FOR EACH with a BY clause to specify the descending sort and have the only contents of the loop be a LEAVE. This will leave you positioned on that last record reliably.

This thread is closed