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!

How can I get a query to return a zero value??? 2

Status
Not open for further replies.

chubby

Programmer
Apr 28, 2001
278
US
Is there a way to get my query to output an "zero" when I have no value to return?

I have a query that counts number of books sole everyday just based on the books names. (counting a text field)
If no books were soled the query does not work or I should say does not return a value. I want a zero just as a place holder for my daily report. Is there any way of doing that?

I tried: IIF is null ([field name], "0,")
IIF ([field name] is null, "0")

Why this won't work????
 
Try this...

iif(isnull([field name]),0,[field name])

 
HiBoo, thanks a million, it worked. It does exactly what I was want it to do...

iif(isnull([field name]),0,[field name]) Works just fine...
So, there are more great helpers out there hard at work beside SUPERMAN JOE Miller!!! Thanks again...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top