Results 1 to 2 of 2
  1. #1
    jj1 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2014
    Posts
    128

    Unhappy Calculating days between Start Date and Today ?

    Hi I have form which automatically takes a start value for today the fieldname is Date.


    now what I want to do is calculate the difference between Date and Today's date in days with 2 criteria's
    Ist criteria will be choosing the field which has a boolean field named Was Issue Resolved and has value as Null or False
    and second criteria will be to show only days with greater than 21 days

    This is what I m trying to do

    Expr3: DateDiff("d",[Date],[date()])

    but gives me error on date() as it can't find this parmater

    I tried this also
    >=DateAdd("d",-21,Date())

    But its not population difference between the Date and Today Date

    Please Help

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Try removing the square brackets in this expression:

    Change : Expr3: DateDiff("d",[Date],[date()])
    to
    Expr3: DateDiff("d",[Date],date())

    Also, I strongly suggest that you rename the [Date] field - "Date" should be considered a reserved word, even though it often does work as a field name, because if you forget the square brackets, the results will be unpredictable.

    John

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

Similar Threads

  1. Replies: 1
    Last Post: 11-26-2013, 09:25 AM
  2. Replies: 3
    Last Post: 09-24-2013, 07:33 AM
  3. Replies: 7
    Last Post: 01-28-2013, 05:21 PM
  4. Replies: 5
    Last Post: 10-12-2012, 11:00 AM
  5. start date with lapse days
    By adar in forum Access
    Replies: 3
    Last Post: 08-07-2011, 11:08 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