Results 1 to 2 of 2
  1. #1
    eusebio is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2018
    Posts
    1

    Dcount function with multiple criteria

    Dear Friends,


    I'm trying to use de function Dcount with two different criterias (date and user_name) in order to count the number of records in my db. I tryed something like this :

    cont = DCount("*", "table_cad_cursos", "[description] = '" & txt_description & "' AND [date] = ' " & Date & "' ")

    but it keeps returning the error 3464. I reckon that the problem is in the second part of the criteria, maybe something about the format of the Date function.

    Any suggestion ?

    Thank you very much

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,035
    Date parameters use # delimiter instead of apostrophe. Don't put a space after the delimiter.

    Date is a reserved word. Should not use reserved words as names for anything.

    You only want to count records for the current Date?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. DLOOKUP Function for Multiple Criteria.
    By cap.zadi in forum Forms
    Replies: 9
    Last Post: 05-31-2017, 05:01 PM
  2. DCount Multiple Criteria Not Working
    By seantnash in forum Queries
    Replies: 6
    Last Post: 08-19-2016, 02:40 PM
  3. Replies: 2
    Last Post: 02-26-2014, 05:06 PM
  4. DCount with Multiple Criteria
    By Newbie11 in forum Reports
    Replies: 4
    Last Post: 05-25-2012, 09:04 AM
  5. How do you use DCOUNT for multiple criteria?
    By wwhit in forum Programming
    Replies: 5
    Last Post: 05-15-2012, 11:14 AM

Tags for this Thread

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 - Senior Forums