Finding Maximum Date In A Column

T

Tedd

I am trying to find the maximum date in a column. For
example I have a table that looks like this:

John $100 09/01/01
Jane $300 01/02/03

I want the query to bring back the row with the most
recent date...in this case the second row.

I tried doing a maximum date but it will not let me.

If anyone knows how to do this please let me know.

Thanks.
 
T

Tom Ellison

Dear Tedd:

First, I would like you to check your assumptions. You say, "I want
the query to bring back the row with the most recent date."

This statement seems to make the assumption that there is only one row
for any given date. If that is not the case, then the best you can
hope for is to bring back ALL the rows having the most recent date.

Or prehaps your column with date also has times of day recorded.

In any case, the query would be:

SELECT *
FROM YourTable
WHERE YourDate = (SELECT MAX(YourDate)
FROM YourTable)

Replace table and column names with actual names.

I am trying to find the maximum date in a column. For
example I have a table that looks like this:

John $100 09/01/01
Jane $300 01/02/03

I want the query to bring back the row with the most
recent date...in this case the second row.

I tried doing a maximum date but it will not let me.

If anyone knows how to do this please let me know.

Thanks.

Tom Ellison
Ellison Enterprises - Your One Stop IT Experts
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top