Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2005, 12:15 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default =Count() with WHERE in Report

Okay,

   I am hoping someone will come up with this here. I know you folks know it.

   I am creating totals on a report. Normally I might create a text box with the following expression:

=Count([SSN])

This would count all the SSN fields on the related section.

What I need to do is something like this:

=Count([PositionID]) WHERE Me.PositionID = "Vacant"

So this would count only the positions that were vacant on the report.

Can I do this, or do I need a sub report or something?

Thanks for your time,


mmcdonal
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
 
Old May 12th, 2005, 03:18 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I had to consult another 'expert' on this, but it looks like it may work

=Sum(IIf([PositionID]="Vacant",1,0)

Let us know

Mike


Mike
EchoVue.com
 
Old May 13th, 2005, 06:33 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Thanks dude, that wrox!

I had to modify it slightly to use the correct field (my fault in the first post) and to add a closing paren.:

=Sum(IIf([EMPLOYEENAME]="Vacant",1,0))

mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL: Count = Count + 1 elayaraja.s XSLT 3 July 18th, 2008 03:21 AM
count lk79 XSLT 7 February 17th, 2008 03:07 PM
Total Count of Specific Records in a Report Odeh Naber Access 5 August 1st, 2007 03:50 AM
is there any in built function to count page count g.tamilselvan MySQL 1 February 15th, 2006 07:43 AM
Count, sum, count a value, return records CongoGrey Access 1 April 18th, 2005 02:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.