Results 1 to 6 of 6
  1. #1
    JonathanT is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    118

    DCount formula help


    I'm trying to count the number of Yes values in a query. I'm having trouble getting the right answer.
    There are 38 records in the query and 11 have a Yes in the ValetSvc field. If I don't add any criteria the result is 38. I need to add criteria that will give me the correct answer of 11

    =DCount("[ID1]","[All]",[ValetSvc]='Yes') This formula returns 0

    =DCount("[ID1]","[All]","[ValetSvc]='Yes'") This formula returns an error

    Any help would be appreciated.

  2. #2
    Eljefegeneo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    14
    Not sure if your field [ValetSvc] is text, but if it is then:
    =DCount("[ID1]","[All]",[ValetSvc]="Yes")

  3. #3
    Eljefegeneo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    14
    Sorry, I meant:
    =DCount("[ID1]","[All]","ValetSvc = 'yes'")

  4. #4
    Eljefegeneo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    14
    Sorry again forgot to add it is is T/F (or Yes/No) then
    =DCount("[ID1]","[All]","[ValetSvc1]=Yes")

    Too tired to think straight, going to sleep.

  5. #5
    JonathanT is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    118
    It's a Yes/No field and that formula worked. Thank you

  6. #6
    Eljefegeneo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    14
    Glad to hear that I was able to help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 19
    Last Post: 07-13-2015, 10:15 AM
  2. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  3. DCount
    By Newbie11 in forum Reports
    Replies: 4
    Last Post: 08-03-2012, 12:23 AM
  4. DCount
    By Ray67 in forum Queries
    Replies: 2
    Last Post: 06-26-2012, 10:48 AM
  5. Help with Dcount
    By tozey in forum Programming
    Replies: 1
    Last Post: 08-10-2010, 10:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums