Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Picking maximum date from group of accounts
Message
 
 
To
30/03/1998 15:42:56
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00088209
Message ID:
00088348
Views:
26
>Hey everyone, sorry if this is such a novice question, but I am having problems trying to pick a subset of accounts from data that looks like the following:
>
>acct# agmt date name
>123 12/10/91 john smith
>123 12/10/96 john ross
>321 01/20/91 mary kay
>321 01/20/96 mary jones
>
>I want to just select the account#'s which have the latest 'agmt date'. I have tried the following but it is not reliable when working with a large subset of data and many (sometimes 8 or more) account numbers:
>
>sele *, max(agmt_date) from xxxx group by acct#
>
>Any help is appreciated greatly!!


If you want the last date for each acct#.

SELECT * FROM xxxx GROUP BY acct# ORDER BY acct#,agmt_date DESCENDING

Mike
Michael McLain
Previous
Reply
Map
View

Click here to load this message in the networking platform