Solved

access Dcount of yes no field

Posted on 2010-08-15
4
430 Views
Last Modified: 2013-11-28
I have a form in a datasheet view.  I have a few txt fields where I use the Dsum function to show me totals on the form.  Ex: for the Finish column I use:

=DSum("[DrFin]","DoorTagLog","[BatchID] = " & [ID])
This sums up the values in the table DoorTagLog for the DrFin so I can see it in the Main form which is bound to the Main JobsDoor table.

I have a field in the DoorTagLog table that is a yes/no field called DrTagShip.  I have a txt field on my main form called "To Ship".

The ToShip =  number of finished doors - shipped doors.

I have the number of finished doors = DSum("[DrFin]","DoorTagLog","[BatchID] = " & [ID])

I am having a hard time getting the Dcount working to figure out how many doors have shipped. Here is what I have tried so far:

=DCOUNT("[DrTagShip]","DoorTagLog","[BatchID] = " & [ID] and "[DrTagShip] = '-1'")

It returns the same value in each row of the datasheet = 1699  -  I am trying to count the nunber of yes values for each Job.

Any suggestions?

Thanks for your help.

0
Comment
Question by:johnmadigan
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 250 total points
ID: 33441059
=DCOUNT("[DrTagShip]","DoorTagLog","[BatchID] = " & [ID] & " and [DrTagShip] = True")
0
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 250 total points
ID: 33441079
see the difference from your dcount

=DCOUNT("[DrTagShip]","DoorTagLog","[BatchID] = " & [ID] and "[DrTagShip] = '-1'")

revised dcount

=DCOUNT("[DrTagShip]","DoorTagLog","[BatchID] = " & [ID] & " and [DrTagShip] = -1")

0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 33441114
johnmadigan,Just for reference, internally Access stores boolean True as -1.  Thus, [DrTagShip] = True and [DrTagShip] = -1 are equvalent tests.:)Patrick
0
 

Author Closing Comment

by:johnmadigan
ID: 33441121
Thanks - I knew I was missing something with the syntax - I love a quick fix.

I am usind the Dsum in the txt field of the datasheet - any advantages to  using a subquery in the main form query to do the same thing?

thanks again for the help.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now