Results 1 to 3 of 3
  1. #1
    Clexidr@ is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2017
    Location
    Italy
    Posts
    4

    Dcount and between


    Hello,

    I input this in a text box in a form but I receive an "error" message:
    =DCount("[ID_Orders]";"Orders";"[Due Date] Between #01/02/2017# And #28/02/2017#")

    Can you help me ?

    Thanks.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,424
    usual convention is to use comma's rather than semi colons, but some languages do use semi colons instead.

    =DCount("[ID_Orders]","Orders","[Due Date] Between #01/02/2017# And #28/02/2017#")

    also your dates need to be in US format of mm/dd/yyyy

    your code as written will provide count of records between 2nd Jan and 28th Feb (Access is bright enough to see the 28 is not in the range 1 to 12, so assumes this is in the format dd/mm/yyyy)

    other things that can cause an error - you don't have a table called Orders and/or you don't have fields called ID_Orders and Due Date

  3. #3
    Clexidr@ is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jun 2017
    Location
    Italy
    Posts
    4
    Thanks, indeed I had a problem with the data format.

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

Similar Threads

  1. DCount help
    By McArthurGDM in forum Programming
    Replies: 6
    Last Post: 06-15-2015, 04:30 PM
  2. DCount
    By Newbie11 in forum Reports
    Replies: 4
    Last Post: 08-03-2012, 12:23 AM
  3. DCount
    By Ray67 in forum Queries
    Replies: 2
    Last Post: 06-26-2012, 10:48 AM
  4. DCount and SQL
    By DSTR3 in forum Queries
    Replies: 3
    Last Post: 12-06-2010, 03:07 PM
  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