Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get my query to return the number zero

Status
Not open for further replies.

chubby

Programmer
Apr 28, 2001
278
US
I have a query which counts the number of females assigned to the Engineering Department. The problem is sometimes there are no females in Engineering, I need my query to return a zero not Null.

I tried the IIF(IsNull([field1],0,)

Someone said use =NZ but how???
 
How are you querying the table? The following query and function should return 0 rather than NULL if no records are found.

Select count(col1) From tableA Where gender='F'

=DCount("[col1]","tableA,"[gender]='F'") Terry

"I'm not dumb. I just have a command of thoroughly useless information." - Calvin, of Calvin and Hobbes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top