Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

access Dcount of yes no field

Posted on 2010-08-15
4
Medium Priority
?
531 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 93

Accepted Solution

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

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 1000 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 93

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
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 …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

636 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