473,803 Members | 3,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with DCount

Hello, I am hoping someone can help me and tell me how to correct my
problem.
My report is based on an Invoice query, where each invoice has a date,
amount and corresponding week number. In the report in the detail
footer, I want a summary by week number for Total Invoice Amount and
count of number of Invoices with zero amount. I can get the invoice
total amount, howerver, the count of invoices with zero amount returns
the same amount for each week number which is the overall report total
for each week rather than the weekly count.

Below is an example of what I have done so far which is in the detail
footer section:

=DCount("InvNum ","[qryInvCount]","[Sumofsvcamt]=0'")

This returns all of the invoices with zero amount rather than just the
ones for the week.

Any suggestions are appreciated.

Dennis

Aug 12 '07 #1
5 2484
de*****@yahoo.c om wrote:
Hello, I am hoping someone can help me and tell me how to correct my
problem.
My report is based on an Invoice query, where each invoice has a date,
amount and corresponding week number. In the report in the detail
footer, I want a summary by week number for Total Invoice Amount and
count of number of Invoices with zero amount. I can get the invoice
total amount, howerver, the count of invoices with zero amount returns
the same amount for each week number which is the overall report total
for each week rather than the weekly count.

Below is an example of what I have done so far which is in the detail
footer section:

=DCount("InvNum ","[qryInvCount]","[Sumofsvcamt]=0'")

This returns all of the invoices with zero amount rather than just the
ones for the week.

Any suggestions are appreciated.

Dennis
First tell us what section this is really in. The detail section has no footer
nor header.

The Domain aggregate functions return the same value regardless of where you use
them unless you include a field from the report's query in the WHERE argument.
In your case you would need to include the week number field in the WHERE clause
if you want the number per-week.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

Aug 12 '07 #2
On Aug 12, 8:57 am, "Rick Brandt" <rickbran...@ho tmail.comwrote:
den4...@yahoo.c om wrote:
Hello, I am hoping someone can help me and tell me how to correct my
problem.
My report is based on an Invoice query, where each invoice has a date,
amount and corresponding week number. In the report in the detail
footer, I want a summary by week number for Total Invoice Amount and
count of number of Invoices with zero amount. I can get the invoice
total amount, howerver, the count of invoices with zero amount returns
the same amount for each week number which is the overall report total
for each week rather than the weekly count.
Below is an example of what I have done so far which is in the detail
footer section:
=DCount("InvNum ","[qryInvCount]","[Sumofsvcamt]=0'")
This returns all of the invoices with zero amount rather than just the
ones for the week.
Any suggestions are appreciated.
Dennis

First tell us what section this is really in. The detail section has no footer
nor header.

The Domain aggregate functions return the same value regardless of where you use
them unless you include a field from the report's query in the WHERE argument.
In your case you would need to include the week number field in the WHERE clause
if you want the number per-week.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Thanks for the response and the explanation. I will give it a try.

I have a group header for the week number and I have the detail
summarized in the group footer, which I am concerned with now. It is
the group footer that I erroneously referred to as detail footer.

Dennis

Aug 12 '07 #3
de*****@yahoo.c om wrote:
Thanks for the response and the explanation. I will give it a try.

I have a group header for the week number and I have the detail
summarized in the group footer, which I am concerned with now. It is
the group footer that I erroneously referred to as detail footer.
There is likely a solution that doesn't require a domain function at all (which
are best avoided in reports and queries). Try this in the week number footer...

=Sum(IIf([amount]=0, 1, 0))

That should return the number of invoices in the week number group that have a
zero amount.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Aug 12 '07 #4
On Sun, 12 Aug 2007 05:28:05 -0700, de*****@yahoo.c om wrote:
Hello, I am hoping someone can help me and tell me how to correct my
problem.
My report is based on an Invoice query, where each invoice has a date,
amount and corresponding week number. In the report in the detail
footer, I want a summary by week number for Total Invoice Amount and
count of number of Invoices with zero amount. I can get the invoice
total amount, howerver, the count of invoices with zero amount returns
the same amount for each week number which is the overall report total
for each week rather than the weekly count.

Below is an example of what I have done so far which is in the detail
footer section:

=DCount("InvNum ","[qryInvCount]","[Sumofsvcamt]=0'")

This returns all of the invoices with zero amount rather than just the
ones for the week.

Any suggestions are appreciated.

Dennis
Well, I see an extraneous ' in your code. "[Sumofsvcamt]=0'")
Try:
=DCount("*","[qryInvCount]","[Sumofsvcamt]=0")

The above assumes [Sumofsvcamt] actually contains the value of 0, and
is not simply Null.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 12 '07 #5
On Aug 12, 9:50 am, "Rick Brandt" <rickbran...@ho tmail.comwrote:
den4...@yahoo.c om wrote:
Thanks for the response and the explanation. I will give it a try.
I have a group header for the week number and I have the detail
summarized in the group footer, which I am concerned with now. It is
the group footer that I erroneously referred to as detail footer.

There is likely a solution that doesn't require a domain function at all (which
are best avoided in reports and queries). Try this in the week number footer...

=Sum(IIf([amount]=0, 1, 0))

That should return the number of invoices in the week number group that have a
zero amount.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Thank you so much, that was the answer.

Thanks for the help,

Dennis

Aug 12 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3010
by: Classified | last post by:
Hey There, Have a problem, hopefully someone out here can lend me a hand. Working on an appointment databases, haven't used VBA in ages and I am find a lot of rust everywhere. What I'm trying to do, search the databases using Dcount for any records that match the Date and time of the appointment prior to it being added to the database, however have not been successful. Moreover I was looking for
7
5597
by: jdph40 | last post by:
I posted this problem previously and received excellent help from Wayne Morgan. However, I still have an unanswered question. My form (frmVacationWeeks) is opened from the OnClick event of a button on another form (frmEmpList) which has a list box that contains the names of all employees. When a name is selected in the list box and the button is clicked, frmVacationWeeks opens and is filtered using the following: ". IN (" & Left(strSQL,...
1
1535
by: Simon Matthews | last post by:
Hope someone can help an Access beginner! I've just started keeping my surgical logbook on access and it's a simple flat-file affair. I have created several queries that will list cases performed at different hospitals and reports based on the queries to print out the relavent details. What I would like to do is have a summary sheet in the Report Footer section that lists a grid of each type of procedure performed as well as the...
15
2978
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting it. Simple database: I want to have a user enter Supply Orders (just for tracking purposes) by Item. The user may also enter a new item - "new" is a combination of Item, PartNumber and Vendor - they could have the
4
1707
by: DGolfer | last post by:
I have a Tabular Form which lists my score per hole in the way of "Par" "Birdie" ect. I need to create a Text box which counts the number of times "Par" is listed or each hole. EG: Form Name is: VPar1 Form Field Name is: VPar01 (lists the data below) Reord Source is: VPar1 (this is a query) After 6 games Hole01 in the Tabular form shows:-"
3
1572
by: Saxman | last post by:
=DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'") The above works fine. It sums up the number of therapists who specialise in a particular treatment. I need to add which therapists are active (available). I have tried doing this with the AND function, but I have not got it quite right.
8
1978
by: DP | last post by:
hi, i've got a price of code, which checks to see if a film is on rent, or available. but how can i actualyl make the cancel button do somthing? because, the cursor gets stuck on the filmID field. this is wat i've got so far; Private Sub FilmID_BeforeUpdate(Cancel As Integer) If DCount("*", "tblFilmRental", "FilmID=" & Me!) > 0 Then Cancel = True
2
1748
by: Kaspa | last post by:
Hello I am trying to create dcount field but is not working I have tried every way possible and I can't get it to work. here is my code: =Dcount("","qryTotalscratched"," in (6,7,8,9) and between #01/01/2001# and " & ) I also tried:
0
4115
by: hagar | last post by:
Hi all, I have a problem which I can not understand why this is happening! Debugging this I actually see that it grabs first record then when stepping through code to the line rsImportTo.AddNew it drops first record and grabs second record and continues on no problems (but no 1st record in data set) I am reading a text file record 1 is a top of text file. see code below Private Sub CmdFetchNewData_Click() on Error Goto CmdfetchErr Dim...
2
1367
by: cephal0n | last post by:
I am in a great need of help here, I’m using union sql using access for the firs time and I'm stuck with this problem, I used a DCount to count records and create a single line of results, here is the code. SELECT "A) No. Workorder Completed" As Field, DCount("!","", "!Is Not Null") + DCount("!","", "!='1'") As From; UNION SELECT "B) No. Workorder for the Month" As Field, DCount("!","", "!Is Not Null" ) + DCount("!","", "!Is Null")...
0
9700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10546
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9121
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.