T
Teri Welch
Hello,
In Access 2000 SP3, we have a query built over a linked table (Foxpro DBF)
of order detail records. The query has a WHERE clause to filter the records
and we are calculating the sum() of the EXTPRICE field for the resulting
recordset. But the query is not calculating the sum correctly, in fact if we
run and rerun the query several times, we get several different values
(despite no changes being made to the underlying data or the query
definition) The COUNT() function reveals that the record count is
fluctuating too, albeit slightly, each time the query is run. After
experimenting a little, it seems the problem is somehow connected with one
selection criteria (shown in bold below) intended to omit all records whose
ITEM begins with "SHIP" while including everything else (even NULL items).
We dont underdstand why but when that criteria is removed the query runs
correctly. Can anyone help us understand what's happening and advise us how
to resolve this strange problem. Thank you.
Teri
SELECT A.* FROM ORDDET AS A
WHERE (((A.orderdate) BETWEEN #4/1/2007# And #4/30/2007#)
AND ((A.ordertype)<>'T' Or (A.ordertype) Is Null)
AND ((Mid$(Trim$([item]) & '',1,4))<>'SHIP' Or (Mid$(Trim$([item]) &
'',1,4)) Is Null));
In Access 2000 SP3, we have a query built over a linked table (Foxpro DBF)
of order detail records. The query has a WHERE clause to filter the records
and we are calculating the sum() of the EXTPRICE field for the resulting
recordset. But the query is not calculating the sum correctly, in fact if we
run and rerun the query several times, we get several different values
(despite no changes being made to the underlying data or the query
definition) The COUNT() function reveals that the record count is
fluctuating too, albeit slightly, each time the query is run. After
experimenting a little, it seems the problem is somehow connected with one
selection criteria (shown in bold below) intended to omit all records whose
ITEM begins with "SHIP" while including everything else (even NULL items).
We dont underdstand why but when that criteria is removed the query runs
correctly. Can anyone help us understand what's happening and advise us how
to resolve this strange problem. Thank you.
Teri
SELECT A.* FROM ORDDET AS A
WHERE (((A.orderdate) BETWEEN #4/1/2007# And #4/30/2007#)
AND ((A.ordertype)<>'T' Or (A.ordertype) Is Null)
AND ((Mid$(Trim$([item]) & '',1,4))<>'SHIP' Or (Mid$(Trim$([item]) &
'',1,4)) Is Null));