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 in my text field count

Status
Not open for further replies.

chubby

Programmer
Apr 28, 2001
278
US
How can I get my query to return the number zero in a text field using count? The IIF function does not work.
 
I'm unclear what you mean. If you are counting the records and want the result returned as text instaed of number use
the CStr function.

Select Cstr(Count(*)) As Cnt From table

If you only want it to be text when zero and numeric otherwise. Add the IIF Function.

Select IIf(Count(*)=0,"0",Count(*)) As Cnt From table

Let me know if these samples help you get closer to meeting your requirement. Terry

"I shall try to correct errors when shown to be errors, and I shall adopt new views so fast as they shall appear to be true views." - Abraham Lincoln
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top