Count of differing values

  • Thread starter Thread starter Sue
  • Start date Start date
S

Sue

Hi,

I have a problem similar to the message with the Subject
"Count 1, 2, 3 down a report". My report lists info
about different work priorities (the number(s) depend on
what the user gives in a parameter in a query). I would
like a count at the top of the report of each, such as
"Number of priority 1: ?? Priority 2: ??" ...ect.
BTY I tried to use a query that does this for me inside
the query I use for the report, but it does not work.
Any suggestions would be greatly appreciated.
 
Hi Sue,

Hoping that your Parameter Query has something like the following:
Field: OrderID
Criteria: Forms![name of Form]![textbox]

Then you could use for control source of textbox controls in your Report
(not efficient but it works):

=DCount("[OrderID]","[table name]","[OrderID] = ' " & Forms![name of
Form]![textbox] & " ' ")

Or if your Query is not doing the above then you could hardcode the above
DCount function:

=DCount("[OrderID]","[table name]","[OrderID] = 1")
=DCount("[OrderID]","[table name]","[OrderID] = 2")
=DCount("[OrderID]","[table name]","[OrderID] = 3")

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support
(e-mail address removed)
"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."

This posting is provided "AS IS" with no warranties, and confers no rights


--------------------
| Content-Class: urn:content-classes:message
| From: "Sue" <[email protected]>
| Sender: "Sue" <[email protected]>
| Subject: Count of differing values
| Date: Wed, 7 Apr 2004 13:38:52 -0700
| Lines: 11
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcQc4FacJABtTCTPQ0mt8lqxkjQbzQ==
| Newsgroups: microsoft.public.access.reports
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.reports:135430
| NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
| X-Tomcat-NG: microsoft.public.access.reports
|
| Hi,
|
| I have a problem similar to the message with the Subject
| "Count 1, 2, 3 down a report". My report lists info
| about different work priorities (the number(s) depend on
| what the user gives in a parameter in a query). I would
| like a count at the top of the report of each, such as
| "Number of priority 1: ?? Priority 2: ??" ...ect.
| BTY I tried to use a query that does this for me inside
| the query I use for the report, but it does not work.
| Any suggestions would be greatly appreciated.
|
 
Don't use any domain aggregate function such as DLookup(). If is much more
efficient and accurate to use:
=Sum( Abs( [WorkPriority]=1))
=Sum( Abs( [WorkPriority]=2))
=Sum( Abs( [WorkPriority]=3))

I would actually recommend creating a totals query and use it as the record
source for a subreport.
 
Back
Top