How to ensure Dmax function accounts for maximum date and actual time
<p>Quick question. I have a reference query that is meant to pull the most recent transactions in the 1transaction table based off of the max date. That said, the query works, however when dealing in transactions that have occurred on the same day, it has some issues. The Dmax function does not know how to account for transactions that occur on the same date and pick the most recent by date and time. In essence this query feeds into a drop down form object that disallows customers to check out an asset if it is already checked out. The query again works except for in situations where an asset was checked in and out on 1 day, and checked out again on the same day. In these cases the query does not know how to prevent something that has been checked out, from being checked out. Please help me figure this out. Below is my SQL.  </p>

<pre><code>SELECT [1Transactions].ID
    ,[1Transactions].Asset
    ,[1Transactions].[Checked  Out To]
    ,[1Transactions].[Checked Out Date]
    ,[1Transactions].[Due Date]
    ,[1Transactions].[Checked In Date]
    ,[1Transactions].[Checked In Condition]
    ,[1Transactions].[Checked Out Condition]
    ,[1Transactions].Notes
    ,*
FROM 1Transactions
WHERE ((([1Transactions].Asset) = [Forms] ! [Check In_Out] ! [Lease_Num]))
    AND [1Transactions].[Checked Out Date] = dMAX("[Checked Out Date]", "[1Transactions]", "[Asset]=" &amp; """" &amp; [Forms] ! [Check In_Out] ! [Lease_Num] &amp; """");
</code></pre>