Question: I have the following simplified table structure in a SQL 2000 Databse:

```
ID  AppName  Key    Value   EffectiveDate
--  -------  -----  ------- -------------
1   App1     One    Past    1/1/1900
2   App1     One    Present 1/1/2010
3   App1     One    Future  1/1/9999
4   App1     Two    Past    1/1/1900
5   App1     Two    Present 1/1/2010
6   App1     Two    Future  1/1/9999
7   App2     One    Present 1/1/2010
8   App2     Two    Present 1/1/2010

```

I need to be able to ask the question:

Given a specific `AppName`, show me all **ONLY THE MOST RECENT** Key/Value pairs whose `EffectiveDate <= GetDate()`

So if I called my mystery query with `AppName = 'App1'` then my results would be:

```
ID  AppName  Key    Value   EffectiveDate
--  -------  -----  ------- -------------
2   App1     One    Present 1/1/2010
5   App1     Two    Present 1/1/2010

```

EDIT:
-----

Value can be anything. ('Past','Present','Future') were merely used to make the example more clear. They could very well have been (45,'Bob','%$#%@#$').

Answer: 
Something more like this to get the latest relative date.

```
SELECT *
FROM your_table
WHERE AppName = 'App1'
AND DATE = (SELECT MAX(EffectiveDate ) 
             FROM your_table
             WHERE APPName = 'App1'
              AND EffectiveDate <= GetDate())

```
Seems like a fairly basic SQL query:

```
select *
from App
where AppName = 'App1'
    and EffectiveDate <= GetDate()

```

There's a fair bit of information around on SQL queries, but this is a pretty good starter: <http://www.w3schools.com/sql/sql_where.asp>