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

Dcount in MSaccess

P: 1
Hello all

My SQL View of my Query in Access 2002.
Expand|Select|Wrap|Line Numbers
  1. SELECT Result.LotName, DCount("[Category]","Result","[Category] >21") AS Expr1
  2. FROM LotProperty INNER JOIN Result ON LotProperty.LotName = Result.LotName
  3. GROUP BY Result.LotName;
I need to count the category which is greater than 21 from the table Result and group by Lot name.

it is showing all same values.

can anybody help.
Sep 21 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
Try this instead ....

Expand|Select|Wrap|Line Numbers
  1. SELECT Result.LotName, Sum(IIf([Result].[Category]>21,1,0)) AS CountLots
  2. FROM LotProperty INNER JOIN Result 
  3. ON LotProperty.LotName = Result.LotName
  4. GROUP BY Result.LotName;
  5.  
Sep 21 '07 #2

Post your reply

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