Hi all,
I`m an Access newbie and could use some help here. I`ve made a query
and it works fine. Now I want the query to display the value for a
field only if the value is > 0. I`ve tried inserting
> 0
into the criteria for the field in the query editor, but this removes
all the records from the query result in which the mentioned field
value is 0. I still want to have the query display the records and all
the values in the other fields - how do I do this?
Terry Kreft - 13 Jan 2006 11:02 GMT
So it's doing what you say you want.
I suspect you're looking for ...
>=0
... as your criteria.

Signature
Terry Kreft
> Hi all,
>
[quoted text clipped - 8 lines]
> value is 0. I still want to have the query display the records and all
> the values in the other fields - how do I do this?
epost2@gmail.com - 13 Jan 2006 11:15 GMT
Thanks for the reply. >=0 is not what I`m looking for here. I want the
field to evaluate to nothing (blank) if the value is 0, is this
possible?
Terry Kreft - 13 Jan 2006 11:50 GMT
You don't want a criteria then; criteria are used to filter the recordset
not set field values.
In Access you can use the IIF (Immediate IF) statement.
So something like
SELECT
IIf([myfield]>0,[myfield],'') AS Expr1
FROM
mytable;
Change the myfield and mytable labels to match your field and table paste it
into SQL view of a query and see if that gives what you want.

Signature
Terry Kreft
> Thanks for the reply. >=0 is not what I`m looking for here. I want the
> field to evaluate to nothing (blank) if the value is 0, is this
> possible?
Arno R - 13 Jan 2006 12:01 GMT
Maybe you want this?
In the querygrid type this in a new column:
ValueIfNotZero:IIF([YourField]=0;"";[YourField])
Arno R
> Thanks for the reply. >=0 is not what I`m looking for here. I want the
> field to evaluate to nothing (blank) if the value is 0, is this
> possible?
epost2@gmail.com - 13 Jan 2006 12:21 GMT
Thanks to both of you. Thats what I needed.