Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement
Message
From
16/09/2005 03:39:43
 
 
To
16/09/2005 03:29:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01050157
Message ID:
01050160
Views:
9
>Hi Guys,
>
>I have an SQL table named itemledger which contains 3 columns (itemid,whcode,docdate). The table consist of records having the same itemid and whcode but with different docdate.
>
>Example:
>
>001 MIS     08/01/2005
>001 MIS     08/15/2005
>001 ACCT  09/08/2005
>001 ACCT  09/15/2005
>
>From here, I want to query this table to return the grouped itemid & whcode with the latest dodate.
>
>Expected Result from the query:
>001 MIS     08/15/2005
>001 ACCT  09/15/2005
>
>Is there a way to formulate a Query Statement that would return these results?
>
>Thanks in Advance...

Mike,
select  itemid, ;
        whcode, ;
        max(docdate) as docdate ;
  from itemledger ;
  into cursor tmp ;
  group by 1, 2
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform