SELECT MAX( cast( DateTimeField as Date)) from MyTable
Now...if you want to find all the rows (i.e. transactions) that have that same date as the max date
SELECT * from MyTransactions
where cast( DateTimeField as date) = (SELECT MAX( cast( DateTimeField as Date)) from MyTransactions)
>Hi,
>
>I am working on creating a SQL Select (against a SQL Server) to find a record with the most recent DATETIME field. But I am only concerned with the DATE portion of this DATETIME field (since the time is irrelevant). Here is a small pseudo example:
>
>select Date_Time from MyTable where Date_Time_Is_Most_Recent
>
>
>TIA