Or maybe the Domain specified for both the Dmin and Dmax should be something
different-this would make things (or at least my limited understanding of
things), more difficult.
There are other ways I could do this, I know there are...this just doesn't
make sense to me, so I sort of feel like I'm obliged to understand why this
doesn't work. Sorry for the hassle. When I switch the query to sql, it
looks like this:
SELECT tblITEMS.ITEMNAMEDESCRIPTION, tblITEMS.UNITPRICE AS [Normalized Price]
FROM tblPROJECTS INNER JOIN tblITEMS ON tblPROJECTS.PROJECTID =
tblITEMS.PROJECTID
WHERE
(((tblITEMS.UNITPRICE)<DMax("UnitPrice","tblItems","ITEMNAMEDESCRIPTION = """
& Replace([ITEMNAMEDESCRIPTION],"""","""""") & """") And
(tblITEMS.UNITPRICE)>DMin("UnitPrice","tblItems","ITEMNAMEDESCRIPTION = """ &
Replace([ITEMNAMEDESCRIPTION],"""","""""") & """")) AND
((tblPROJECTS.BIDDATE)>=DateAdd("m",-13,Date())) AND
((tblPROJECTS.WORKTYPE)=[Forms]![frmMAINMENU]![cboWorkTypePick]));
Unit Price is currency, ITEMNAMEDESCRIPTION is text, WORKTYPE is text. I'm
trying to structure a query so that the prices that are returned are: within
the last 13 months, are within a specified work type and are the middle
prices that exclude the highest and lowest values. It seems like I get the
values I want except that the lowest value does not take into consideration
the date restriction. This query it seems, removes the lowest value from the
whole table and not from just within the specified projects.
Thanks for helping me, just being able to talk (well, write) about it is
helping, thanks.
--
http://njgin.aclink.org
John W. Vinson said:
If I had the following values in the 'UnitPrice' column: 300, 300, 300 & 640;
and these were found within the 'tblItems' table for a single
'ITEMNAMEDESCRIPTION' and I used this expression:
<DMax("UnitPrice","tblItems","ITEMNAMEDESCRIPTION = """ &
Replace([ITEMNAMEDESCRIPTION],"""","""""") & """") And
DMin("UnitPrice","tblItems","ITEMNAMEDESCRIPTION = """ &
Replace([ITEMNAMEDESCRIPTION],"""","""""") & """")
within the expression builder,
what would the results of this selection query be?
Please post the complete SQL of the query, and some indication of what the
data looks like (other than these four values). I'm perplexed!