Minggu, 16 Maret 2014

Re: [MS_AccessPros] Query to select the second number in a series of number

 

Try something like this, change the 3 to other values to get other rows of the table.
 
SELECT top 1 Table1.* FROM Table1
Where Ticker = "myTickersymbol" and InputDate Not in
(SELECT top 3 InputDate FROM Table1 WHERE Ticker="A" ORDER BY InputDate DESC)
ORDER BY InputDate DESC
 



On Sunday, March 16, 2014 8:38 AM, "timdbui@gmail.com" <timdbui@gmail.com> wrote:
 
Would any of you please help me to write this queries:
 have a table that has 3 columns: Col A: ticker, Col B: InputDate, Col C: Comment. The purpose of the table is to keep comments posted on a particular stock.
I can get the latest date by using the MAX function or the oldest date by using MIN function. 
But is there a way to get the second latest date? or third latest date?

Thank you in advance for your help!

Tim



__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
.

__,_._,___

Tidak ada komentar:

Posting Komentar