>I have a table with records in which the only difference in the record data might be the recseq no.(This is a many type table). What I need to do is have a SPT statement that gets three fields. The recseq, partnumber, and description fields. The twist is I only want distinct partnumber values. The recseq could be the max for the partnumber maybe.
>
Try (will work in VFP9 or with VFP9 OLE DB provider only)
SELECT mt.recseq, mt.partnumber, mt.description FROM mytable mt
JOIN (SELECT MAX(recseq) AS maxrecseq, partnumber FROM mytable GROUP BY partnumber) mrs
ON mrs.maxrecseq = mt.recseq AND mrs.partnumber = mt.partnumber
--sb--