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

CountIF in Access

Status
Not open for further replies.

Pamy

MIS
Oct 15, 2002
29
0
0
SG
Hi
I'm wondering if Access 2k has CountIF function?
For eg, i have a form in tabular format
Year | Data
==========
Year 1 | Data
Year 2 | Data
Year 1 | Data
Can i use countif to calculate nos record for Year 1?
 
You can use a WHERE clause in your query instead, e.g.

Code:
SELECT Count([PutNameOfFieldToCountHere]) AS Counter
FROM PutYourTableNameHere
WHERE PutYourTableNameHere.Year='Year 1';

HTH [pc2]
 
You could use DCount

ie. DCount(CountWhat,FromWhere,Condition)

See Access help for a full description.

There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top