By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

Access Count Problem

P: 4
Hi,
i am creating a database for my dads business and i have one problem with one bit. its pretty basic
i have a query that is counting records in column A But it want It not to include records witch have Sold or Used in column B.

please can someone help. its the very last thing i need to complete in my database and its driving me mad
thanks
Jul 20 '07 #1
Share this Question
Share on Google+
4 Replies


NeoPa
Expert Mod 15k+
P: 31,494
Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!). This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

MODERATOR.

PS I've changed it to something more appropriate.
Jul 20 '07 #2

NeoPa
Expert Mod 15k+
P: 31,494
Hi,
i am creating a database for my dads business and i have one problem with one bit. its pretty basic
i have a query that is counting records in column A But it want It not to include records witch have Sold or Used in column B.

please can someone help. its the very last thing i need to complete in my database and its driving me mad
thanks
As for your question, you can do that without too much trouble, but how it is best done depends on exactly what you need. Post in the SQL of your current query and I'll look into it for you.
Jul 20 '07 #3

nico5038
Expert 2.5K+
P: 3,072
Open the graphical query editor and place column B
In the Criteria cell below enter:

NOT IN ('used';'sold')

This will exclude the values.

Nic;o)
Jul 20 '07 #4

NeoPa
Expert Mod 15k+
P: 31,494
This is one of the solutions. This assumes that you only want to include those records from the query. If, however, you want to count those records but include the whole dataset for another field (for instance) then you need to use a construct (in the SQL) like :
Expand|Select|Wrap|Line Numbers
  1. SELECT ...
  2.        IIf([ColumnB] In('Used','Sold'),1,0) AS CountUsedSold,
  3.        ...
  4. FROM [Table]
  5. ...
Jul 22 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.