query criteria eliminates too many record results

S

Susan

I have created 2 identical select queries except that one should display
records with a value greater than zero and the other should display records
less than or equal to zero in the products.productfamily field.

The first query works fine and eliminates all records with a value less than
or equal to zero as I have placed >0 in the query criteria field for the
products.productfamily field

The trouble is that when I type <=0 in order to eliminate all records that
are greater than zero, no record results display even though there are
several records that fit the criteria.

This database field data type is numeric and contains a row source lookup
value.

what can the issue be?
 
M

MGFoster

Susan said:
I have created 2 identical select queries except that one should display
records with a value greater than zero and the other should display records
less than or equal to zero in the products.productfamily field.

The first query works fine and eliminates all records with a value less than
or equal to zero as I have placed >0 in the query criteria field for the
products.productfamily field

The trouble is that when I type <=0 in order to eliminate all records that
are greater than zero, no record results display even though there are
several records that fit the criteria.

This database field data type is numeric and contains a row source lookup
value.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can do this in one query - something like this:

Don't put the criteria in the WHERE clause, put it in the SELECT clause
and use the SUM() aggregate function.

SELECT SUM(IIf(ProductFamily>0,1,0)) AS GTZero,
SUM(IIf(ProductFamily<=0,1,0)) As LTEZero
FROM Products
WHERE [ Date range criteria??? ]


HTH,
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSqc3g4echKqOuFEgEQKdKQCgueBLLpMXz+VQIs1uLp9iOLyDe5EAoIW6
U3Ll5k4ZUXvD3IIJ6V6Mb1N6
=0MOY
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top