Query clue?

Kyriakos

Registered User.
Local time
Today, 09:52
Joined
Feb 18, 2006
Messages
42
Hey everyone. Does anyone know how can I make the latest 2 dates from a specific date field appear on the screen? What should I ask in the criteria?Is there a certain function or something else?
 
K,

Need more info, but you can Group By the date field descending and
select the Top 2.

Code:
Select Top 2 TheDate
From   YourTable
Group by TheDate Desc

Wayne
 
Wayne, I have this field....let's say date field. And it has several dates concerning one event. It's something like:

No Event Date
1 A 1/1/2002
2 A 1/1/2003
3 A 1/1/2004
4 A 1/1/2005

and I want to find through a query the latest 2 dates concerning the A event. e.g. 1/1/2004 and 1/1/2005. Am I more clear now?
 
Oops sorry:D Figured that out!!!! Thanx anyway for that...Perhaps what I really need is much more complex.I have 2 connected tables, and I want the latest 2 (like I said) dates not of the entire table but for each event. I'm trying to combine SELECT TOP 2 and SELECT DISTINCT. Or so I think......
Help anyone?
Thanx....
 
Last edited:

Users who are viewing this thread

Back
Top Bottom