Results 1 to 4 of 4
  1. #1
    Madmax is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    80

    DCount and If

    Good Morning,



    Trying to find the correct way to use an if statement inside of a DCount or vise versus.

    Basically the literal will be: If [Table]![Item 1] has a date (isdate) then If [Table]![Item 2] is yes then DCount all the yes's that has that date only.


    the final formula is going to have up to 8 items to check for different counts but I just need an example with two and I can figure out the rest.

    Thank you,

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    DCount("*", "TableName", "IsDate(Item1) AND Item2 = True)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I would not try to do a dcount of 8 different items, can you construct a query that shows the information you want? if so it would likely be easier and faster for your database to just read the content of the query and then perform whatever action you need based on the result it finds.

  4. #4
    Madmax is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    80
    Actually, that did end up working better. created a sub report inside the original report with a pivot chart still working the kinks though

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

Similar Threads

  1. DSum or DCount
    By vdanelia in forum Forms
    Replies: 1
    Last Post: 03-01-2011, 03:59 AM
  2. DCount for Multiples
    By Huddle in forum Access
    Replies: 2
    Last Post: 12-21-2010, 08:57 AM
  3. DCount and SQL
    By DSTR3 in forum Queries
    Replies: 3
    Last Post: 12-06-2010, 03:07 PM
  4. Help with Dcount
    By tozey in forum Programming
    Replies: 1
    Last Post: 08-10-2010, 10:53 AM
  5. Dcount on report
    By mattbrem in forum Reports
    Replies: 2
    Last Post: 06-06-2009, 01:33 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