Wow, I knew that the "select" command was powerful, but this is incredible
Is there a book out on this ?

Anyhow, Ricardo, many thanks for below example.
Unfortunately, it is not quite right. It gives me the result for the
most recent 52 records
I need the result for the most recent 52 records PER EMPLOYEE (empcode)

Are you able to assist, please

Sytze



> If you want the last 52 cycles (sequentially last) :
>
> select empcode ;
>         into cursor newtable ;
>         from mytable my ;
>         where my.cycle in (SELECT x.cycle ;
>                                 FROM (SELECT TOP 52 aux.cycle, RECNO();
>                                         from mytable as aux ;
>                                         order by 2 desc) as x) ;
>         order by empcode ;
>         group by empcode
>
> > Regards
> > Sytze
> >
> >
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to