Re: Return only most recent date records

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: DataGuy (nospam_at_hotmail.com)
Date: 02/07/05


Date: Mon, 7 Feb 2005 11:17:06 -0500

Hi Ken,

I'm trying to enter this in 'Build...' for my query. Can you check my copy?

SELECT [CAD LOG].* FROM [CAD LOG] WHERE [CAD LOG]![Transfer Date]=(SELECT
Max( [CAD LOG]![Transfer Date] ) FROM [CAD LOG] AS C WHERE C.Part #= [CAD
LOG]![PART #] );

My 2 fields are:

[CAD LOG]![Transfer Date]
[CAD LOG]![PART #]

Thank you.

"Ken Snell [MVP]" <kthsneisllis9@ncoomcastt.renaetl> wrote in message
news:%23RCXNzSDFHA.2180@TK2MSFTNGP12.phx.gbl...
> This is one way to do it:
>
> SELECT [CAD LOG].*
> FROM [CAD LOG]
> WHERE [CAD LOG].TransferDate =
> (SELECT Max(C.TransferDate)
> FROM [CAD LOG] AS C
> WHERE C.PartNumber = [CAD LOG].PartNumber);
> --
>
> Ken Snell
> <MS ACCESS MVP>
>
>
>
> "DataGuy" <nospam@hotmail.com> wrote in message
> news:eGkfOWSDFHA.936@TK2MSFTNGP12.phx.gbl...
>> Hello!
>>
>> I have a table that I use to track files being transferred to & from our
>> company. When a new file arrives, it's 'Transfer_Date' & 'Part_#' is
>> logged.
>>
>> I need to figure out a way to create a query to return only the most
>> recent record for each part number. I thought if I could maybe do
>> something like this:
>>
>> MIN=(Now - [CAD LOG]![Transfer Date])
>>
>> But I cannot get it to return anything. It doesn't error out, but I get
>> no results, so I don't know what to fix.
>>
>> Any suggestions are appreciated.
>>
>> Thank you!
>>
>
>