counter

B

brigid

Is there any way to create a counter using a query? For
example, take fields titled color1, color2, color3,
color4, and entered in the columns respectively are red,
yellow, and blue, but 'color4' is left blank. If I
wanted to determine how many colors were entered in, is
there any way I could query something to the effect of a
counter and then display the total number of colors?
 
D

Dennis Schmidt

Hi Brigid,

My name is Dennis Schmidt. Thank you for using the Microsoft Newsgroups.

The following Knowledge Base article should get you going in the right
direction:

You could use the IIF() function to count fields that had a value. You
would type something like the following on the "Field" line of a column in
the query:

CountColors: IIF(Not IsNull([Color1]),1,0) + IIF(Not IsNull([Color2]),1,0)
+ IIF(Not IsNull([Color3]),1,0)

I hope this helps! If you have additional questions on this topic, please
reply to this posting.

Need quick answers to questions like these? The Microsoft Knowledge Base
provides a wealth of information that you can use to troubleshoot a problem
or answer a question! It's located at
http://support.microsoft.com/support/c.asp?M=F>.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

Regards,
Dennis Schmidt
Microsoft Support
 

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