As Omnibuzz said, more information is needed.
While your query seems to be written for Access, since this is a SQL
Server group I took the liberty of changing it to SQL Server syntax. I
rewrote the query to eliminate some of the levels, but it should
return the same results as the example:
SELECT MAX(fNum)
FROM tTable
WHERE fDate =
(SELECT MAX(fDate)
FROM tTable
WHERE fRegion = 'Califo'
AND fProduct = '1G274'
AND fColor = 'Brown'
AND fDate <= '13 May 2006')
It doesn't do anything new, but it is perhaps another way to
understand what the original is doing.
Roy Harvey
Beacon Falls, CT
[quoted text, click to view] On Tue, 30 May 2006 21:49:02 -0700, x taol <tomi3440@yahoo.com> wrote:
>
>
>
>
>i want to a query.
>
>SELECT MAX(fNum) FROM tTable WHERE fDate IN (SELECT MAX(fDate) FROM
>tTable WHERE fDate IN (SELECT fDate
>FROM tTable WHERE fDate IN (SELECT fDate FROM tTable WHERE
>(fRegion="Califo") AND (fProduct="G274") AND (fColor="Brown") AND
>(fDate<=#5/13/2006#))))
>
>unfortunately, the upper query is not working in my hope.
>i want to following query.
>
>there are records in (fRegion="Califo") AND (fProduct="G274") AND
>(fColor="Brown") AND (fDate<=#5/13/2006#).
>there are records in maximum fDate in the records.
>and then last
>there is record of a maximum fNum in the records.
>
>
>