Expression in Form

F

Fiona

I have a form where i need to put in an expression that
counts records that have a zero as their value. What is
the best way of doing this.
 
M

Michael Keating

Hi,

the expression you need to use is

sum( iif( [field] = 0, 1, 0))

typically it is used to create a field in the query that populates the form.


HTH


MFK.
 
G

Guest

Many thanks that worked well. How would i do it for the
opposite to count the the records with a figure greater
than zero as their value.

Thanks.
-----Original Message-----
Hi,

the expression you need to use is

sum( iif( [field] = 0, 1, 0))

typically it is used to create a field in the query that populates the form.


HTH


MFK.

I have a form where i need to put in an expression that
counts records that have a zero as their value. What is
the best way of doing this.


.
 
F

fredg

Many thanks that worked well. How would i do it for the
opposite to count the the records with a figure greater
than zero as their value.

Thanks.
-----Original Message-----
Hi,

the expression you need to use is

sum( iif( [field] = 0, 1, 0))

typically it is used to create a field in the query that populates the form.


HTH


MFK.

I have a form where i need to put in an expression that
counts records that have a zero as their value. What is
the best way of doing this.


.

Just change the criteria to >0
 

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