By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,139 Members | 1,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,139 IT Pros & Developers. It's quick & easy.

Eliminate Duplicates by Returning Latest Record

P: n/a
I currently have a Table with these fields:

Symbol; Price; Date

with data that looks like this:

IBM; 10; 10/15/2003
IBM; 11; 10/29/2003
GM; 20; 10/15/2003
F; 25; 9/15/2003

I would like a query that will return Symbol, Price and Date without
duplicates, but leaving the record with the latest date in the event
of a duplicate.

Example:

IBM; 11; 10/29/2003
GM; 20; 10/15/2003
F; 25; 9/15/2003

Thanks in advance for your help.

John
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
SELECT tblStockPrices.Ticker, Max(tblStockPrices.Date) AS MaxOfDate,
Last(tblStockPrices.Price) AS LastOfPrice
FROM tblStockPrices
GROUP BY tblStockPrices.Ticker;

Like that?
Nov 12 '05 #2

P: n/a
Try:
Select Symbol, Price, Max(Date)
From tblSomeTable
Group By Symbol, Price

jd****@ironbridgellc.com (John Davis) wrote in message news:<1c**************************@posting.google. com>...
I currently have a Table with these fields:

Symbol; Price; Date

with data that looks like this:

IBM; 10; 10/15/2003
IBM; 11; 10/29/2003
GM; 20; 10/15/2003
F; 25; 9/15/2003

I would like a query that will return Symbol, Price and Date without
duplicates, but leaving the record with the latest date in the event
of a duplicate.

Example:

IBM; 11; 10/29/2003
GM; 20; 10/15/2003
F; 25; 9/15/2003

Thanks in advance for your help.

John

Nov 12 '05 #3

P: n/a
Your Solutions work. Thank you.
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.