Results 1 to 2 of 2
  1. #1
    SWG is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2012
    Posts
    8

    Count Vs Dcount

    "Count" and "Dcount" giving me different output, i was counting the number of Submission Date >= April 01-2011 , Below are the Expression that i wrote & the output i got........



    By Using Count:
    Expression: =Count(IIf([qrySWGOverall]![Submission Date]>=#01/04/2011#,1))

    Output: Total Number of Submission 2011/2012: 22

    By Using Dcount:
    Expression: =DCount("[Submission Date]","qrySWGOverall","[Submission Date]>=#01/04/2011#")

    Output: Total Number of Submission 2011/2012: 24

    ***** Count Expression giving me correct number***** Any suggestions would help.... Thanks for your time.

  2. #2
    Jester0001 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    69
    Access Help (for 2010) says that the Count() function is
    optimized to speed counting of records in queries. Use the Count function in a query expression instead of the DCount function, and set optional criteria to enforce any restrictions on the results. Use the DCount function when you must count records in a domain from within a code module or macro, or in a calculated control.
    From your fomulas, I'm guessing that you are trying to count the records from a query [qrySWGOverall]. If this is correct, and if you get the correct answer by using the Count() function, then why not just go with the Count() function? Or am I missing something?

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

Similar Threads

  1. DCount
    By nsteenhaut in forum Queries
    Replies: 2
    Last Post: 10-04-2011, 05:00 PM
  2. DCount and SQL
    By DSTR3 in forum Queries
    Replies: 3
    Last Post: 12-06-2010, 03:07 PM
  3. Help with Dcount
    By tozey in forum Programming
    Replies: 1
    Last Post: 08-10-2010, 10:53 AM
  4. Using count or Dcount
    By ddcook in forum Access
    Replies: 0
    Last Post: 07-22-2009, 03:35 PM

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