Results 1 to 5 of 5
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528

    Function calculation part

    Hello Guys
    I am trying to put a text box on a form showing me a certain data


    Subfamily of blood groups in certain scale effect in the sense Finished
    The vial of blood has been stored in the refrigerator to save more than 35 days
    I wrote this function, but to no avail
    = DCount ("*"; "tblsettlors"; "(donor = 'o +') and Between Date () And DateAdd (" d "; -35; Date ())
    Any help
    Thank you

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    1) You are missing a field name in the DCount WHERE, and
    2) (I think) the semicolons in the DateAdd function have to be commas, and
    3) The semicolons in the DCount have to be commas,
    4) Remove the blanks in the " d " in DateAdd, and enclose the d in quote mark pairs
    5) You are missing a closing quote in the DCount where

    = DCount ("*", "tblsettlors", "(donor = 'o +') and field_name_missing_here Between Date () And DateAdd (""d"", -35, Date ()")

    If you are using a language setting other than English, my observations regarding semicolons and commas might not be right.

    But the biggest problem there is that you did not indicate which field has to be in the date range.

    HTH

    John
    Last edited by John_G; 03-25-2014 at 12:56 PM. Reason: add more corrections

  3. #3
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much John
    for your reply
    Yes, the field name is (DonorDate)
    But when you insert the expression, this message appears
    Click image for larger version. 

Name:	2223.PNG 
Views:	5 
Size:	37.5 KB 
ID:	15917
    = DCount ("*", "tblsettlors", "(donor = 'o +') and DonorDate= Between Date () And DateAdd (""d"", -35, Date ()")

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    I took another look - there is also a missing ")" in the DCount (in red below):

    = DCount ("*", "tblsettlors", "(donor = 'o +') and field_name_missing_here Between Date () And DateAdd (""d"", -35, Date ())")

    HTH

    John

  5. #5
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you John
    But not prospered
    Is it possible a small example

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

Similar Threads

  1. Calculation Field in table vs Query calculation
    By Leonidsg in forum Database Design
    Replies: 18
    Last Post: 02-28-2013, 09:38 PM
  2. How Can export Large table part by part
    By shabar in forum Import/Export Data
    Replies: 2
    Last Post: 02-04-2013, 06:29 AM
  3. Calculation Function In A Report
    By scubagal in forum Reports
    Replies: 1
    Last Post: 12-27-2011, 02:22 PM
  4. Total Calculation, nz function, not working
    By Jojojo in forum Programming
    Replies: 3
    Last Post: 10-10-2011, 02:33 PM
  5. Various Day Calculation Function
    By access_tom in forum Access
    Replies: 6
    Last Post: 10-13-2010, 02:37 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