Extracting Latest Date
- From: "Jan S via SQLMonster.com" <forum@xxxxxxxxxxxxxx>
- Date: Thu, 04 Aug 2005 07:31:53 GMT
I have a db which stores all my sales transactions.
The task is to extract the buy price(price) for each item(ItemCode) where the
date is the latest for each item.
For Example:
Sales Table
ItemCode Qty Price Date
-------------- ----- -------- --------
XYZ 2 23.50 12/03/05
XYZ 3 23.50 13/03/05
XYZ 2 99.99 14/03/05
ABC 14 88.88 01/01/05
RDB 12 77.30 21/04/05
RDB 23 23.35 02/05/05
I would then require only
ItemCode Qty Price Date
-------------- ----- -------- --------
XYZ 2 99.99 14/03/05
ABC 14 88.88 01/01/05
RDB 23 23.35 02/05/05
How do i write a query to extract the data?
Need help with a project of mine....really stuck with this one..Thank you
.
- Follow-Ups:
- Re: Extracting Latest Date
- From: Hugo Kornelis
- Re: Extracting Latest Date
- Prev by Date: Re: Find Duplicate Data
- Next by Date: Re: Extracting Latest Date
- Previous by thread: Find Duplicate Data
- Next by thread: Re: Extracting Latest Date
- Index(es):