Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00197746
Message ID:
00197809
Views:
16
If latest means highest numeric sequence field (named Numseqfld), try this:

select Lastname,max(Numseqfld) as Latest from Table1 group by 1 into cursor Cursor1

select Table1.Id,Table1.Lastname,Table1.FirstName from Table1;
Join Cursor1 on Cursor1.Lastname = Table1.Lastname ;
where Table1.numseqfld = Cursor1.Latest

Good Luck

>Dan,
>
>Thanks for the help. The syntax you provided
>worked, but I'v come up with a twist on it:
>
>The table has multiple records for each person.
>I want to pull only the LATEST record of any given
>last name. I have a numeric sequence field that I
>use for ordering.
>
>Will the the syntax you provided still work?
>
>Again, I need Id, Lastname, FirstName but only
>the lastest for each person.
>
>Your thoughts?
Previous
Reply
Map
View

Click here to load this message in the networking platform