A Access9001 Registered User. Local time Yesterday, 16:50 Joined Feb 18, 2010 Messages 268 Mar 2, 2010 #1 I want to return everything having count(table.somefield="Some criteria") = 0 but I don't know the syntax. Thanks!
I want to return everything having count(table.somefield="Some criteria") = 0 but I don't know the syntax. Thanks!
Brianwarnock Retired Local time Today, 00:50 Joined Jun 2, 2003 Messages 12,701 Mar 2, 2010 #2 Ithink it will have to be like this Field Countofsomefield: sum(iif(somefield=criteria,1,0) Criteria =0 Brian
Ithink it will have to be like this Field Countofsomefield: sum(iif(somefield=criteria,1,0) Criteria =0 Brian
MSAccessRookie AWF VIP Local time Yesterday, 19:50 Joined May 2, 2008 Messages 3,428 Mar 2, 2010 #3 Access9001 said: I want to return everything having count(table.somefield="Some criteria") = 0 but I don't know the syntax. Thanks! Click to expand... Do you mean something like the following? SELECT YourTable.somefield1, YourTable.somefield2, YourTable.somefield3 FROM YourTable WHERE YourTable.somefield="Some criteria" GROUP BY YourTable.somefield HAVING COUNT(*)=0
Access9001 said: I want to return everything having count(table.somefield="Some criteria") = 0 but I don't know the syntax. Thanks! Click to expand... Do you mean something like the following? SELECT YourTable.somefield1, YourTable.somefield2, YourTable.somefield3 FROM YourTable WHERE YourTable.somefield="Some criteria" GROUP BY YourTable.somefield HAVING COUNT(*)=0
J jay123 New member Local time Today, 00:50 Joined Mar 1, 2010 Messages 9 Mar 3, 2010 #4 Could you also use DCount? =DCount("Fieldname","QueryName","CriteriaField=something") so for example: =DCount("RecordID","OrdersT","CompanyName=ABC") this would count all records in the orders table for the company called ABC.
Could you also use DCount? =DCount("Fieldname","QueryName","CriteriaField=something") so for example: =DCount("RecordID","OrdersT","CompanyName=ABC") this would count all records in the orders table for the company called ABC.
A Access9001 Registered User. Local time Yesterday, 16:50 Joined Feb 18, 2010 Messages 268 Mar 3, 2010 #5 I wound up using two queries -- it was a huge headache trying to get it to work right with one. Thanks!
I wound up using two queries -- it was a huge headache trying to get it to work right with one. Thanks!