use this query:
SELECT max(DateColumnName)
FROM TableName
But, If you are trying to get the highest date value in the database for
every year -
use this query:
SELECT max(DateColumnName)
FROM TableName
GROUP BY DatePart('yyyy',DateColumnName)
>From: "Bryan F. Hogan" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: CF-Talk <[EMAIL PROTECTED]>
>Subject: SQL: Selecting Max Date Entries
>Date: Mon, 5 Jan 2004 12:22:29 -0500
>
>Hi All, I just got back from Vacation and I'm paying for it today.
>
>I have a bunch of entries in the database that have datetime values.
>What I want to do is return all the entries for a single month but only
>the max month and year.
>
>Example:
>
>1/4/2004
>1/3/2004
>12/3/2003
>12/1/2003
>
>For the example above I want it to return the January 04 rows. And if
>the January 04 rows did not exist I want it to return the max previous
>month.
>
>The SQL on this on I'm having trouble with.
>
>Thanks
>Bryan
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

