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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you use COUNT with a Criteria? 1

Status
Not open for further replies.

buecker

Technical User
May 1, 2003
12
US
Can you use the COUNT function with criteria?

For Example: I want to count all dates(same field or multiple fields) that are two weeks old.

Can't seem to use COUNT if I have something in criteria?
 
You can sum a true/false expression to get a count. For instance to count the number of females hired after 1/1/2008, you expression in a totals query would be:

Sum(Abs([Gender]="Female" And [HireDate]>#1/1/2008#) )

You could use the above expression as the control source of a text box in a group section by adding "=" ie:

=Sum(Abs([Gender]="Female" And [HireDate]>#1/1/2008#) )


Duane
Hook'D on Access
MS Access MVP
 
Ah. Okay, that makes sense.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top