>>I have a table with hundreds of records, which can be divided into three groups. What I am going to do is to select the last 50 records for a group, let's say group A,from this table. Is it possible to issue a SQL command and let the thing done? Thanks!
>
>
>SELECT TOP 50
>...
>
>gives you first 50 records. To have the last 50 you can do something like
>
>SELECT TOP 50
>...
>ORDER BY ... DESC
>...
>
>Claude
If you are working in VFP5, Ron's method works. In VFP3 you don't have the "TOP nn" option, so you need to get the WHOLE table. Order it with the DESC clause, then copy to another table:
COPY to Newtable while Recno() <= 50
Should be quite fast.
Barbara P.